Skip to Content

Introducing jQuery.dates

One of the projects I'm working on has need of a date picker (a drop down calendar to help select a date), and some cumbersome date calculations. This all had to fit with the jQuery framework I was using for the project, and there were few libraries out there that would fit just right.

Sure, there are a lot of date picker packages available. Each has it's own quirks or limits. I needed something a little more to my own needs. So I decided to write one for jQuery (though it's not the first), but I also wanted to include some more robust date manipulation tools to make my future work with Javascript dates easier. So we now have jQuery.data.

For a beta release, the tool seems to be doing what I need. With JS now I can ask if a text string is a date (via the isDate method), or add to the date easily with the dateAdd, or find the difference between dates with dateDiff. But the real heart of these utility functions is the parseDate() and format() methods. These allow you to format a date to an arbitrary style, and to convert a text string to a date - even if you don't know the date format (though that is kinda hit and miss right now).

The date picker has a little snazzy animation to it and positions itself right below the textbox it's working with. jQuery is needed for the date picker to work, but the other methods can be used standalone if desired. There are jQuery plugins for them if you'd prefer to use it that way. Though, I'm not quite sure how a jQuery plugin may be best used - I'll have to put the library into production use to get a better feel for that.

If you are interested, you can find details on the following pages:

And there is now also a link in the main navigation above.