Time for jQuery Quick tip number 2! This time, it concerns the datepicker that is built into jQuery UI.
So you’ve implemented the jQuery UI datepicker using the code below:
$(function() { $("#datepicker").datepicker(); });
However this returns by default the date back in US format i.e. The 22nd July would be 07/22/09 . Thats ok if your US based but what if your UK based for example, how do i return the date in UK format i.e. 22/07/09 ?
Well, it’s fairly simple actually! All you need to do is insert the date format within the last set of parentheses eg. $(function() { $("#datepicker").datepicker({dateFormat: 'dd/mm/yy'}); });
This now returns UK format date, you can also put other date format in here, see this link for more details on how to write the date format!
I’ve recently completed another new website. Dillon and Lee Hairdressing, a hair and beauty salon in Nottingham. The site uses a combination of wordpress for the backend/blog/cms and hand written HTML and CSS on the front with a few enhancements using jQuery.
I’m realy enjoying using wordpress at the moment, whilst it wasn’t originally designed as a CMS, i think it’s almost got to the point where they could turn it into a full CMS, it can already basically be done using a few plugins with Wordpress.
I’ve been learning and messing around more with jQuery recently, so i thought it would be a good chance to share some of the stuff i’m learning.
The Problem
I needed to add a focus class to my form input when i clicked the mouse in the input box. I then needed to remove that class and add it to the next input in the form. Well here’s how i did it!
With twitter now all the buzz amongst semingly everyone, i thought i’d take a bit of time to highlight some of the designers i follow on twitter. So here goes: