Member Sign In
Not a member?

A Wired.com user account lets you create, edit and comment on Webmonkey articles. You will also be able to contribute to the Wired How-To Wiki and comment on news stories at Wired.com.


It's fast and free.

Sign in with OpenID
Sign In
Webmonkey is a property of Wired Digital.
processing...
Join Webmonkey

Please send me occasional e-mail updates about new features and special offers from Wired/Webmonkey.
Yes No

Please send occasional e-mail offers from Wired/Webmonkey affiliated web sites and publications, and carefully selected companies.
Yes No

I understand and agree that registration on or use of this site constitutes agreement to Webmonkey's User Agreement and Privacy Policy.
Webmonkey is a property of Wired Digital.
processing...

Retrieve Sign In

Please enter your e-mail address or username below. Your username and password will be sent to the e-mail address you provided us.

or
Webmonkey is a property of Wired Digital.
processing...

Welcome to Webmonkey

A private profile page has been created for you.
As a member of Webmonkey, you can now:
  • edit articles
  • add to the code library
  • design and write a tutorial
  • comment on any Webmonkey article
Close
Webmonkey is a property of Wired Digital.

Sign In Information Sent

An e-mail has been sent to the e-mail address registered in this account.
If you cannot find it in your in-box, please check your bulk or junk folders.
Sign In
Webmonkey is a property of Wired Digital.

Sleek JavaScript Library Solves Your Dating Woes

datejs.jpg

It’s not often that we run across a JavaScript library that’s cool enough to warrant a post, but Datejs really is that cool. Datejs is a simple, fast and very powerful way to add a date picker to your site that accepts all sorts of relative date strings and turns them into standardized date objects.

When most of us encounter a date field on a page we’re accustomed to think in some sort of slash notation, i.e. 11/29/07 if you’re in the U.S or Canada and 29/11/07 if you’re pretty much anywhere else. But slash notation needn’t be the only option, using Datejs your visitors could just as easily type in “tomorrow” or “last November” and Datejs will translate that string into a date format you can pass through for server side processing.

Datejs isn’t perfect, but its a beta release so we expect that authors will clean up some of the edge cases as time progresses. If you’re one of those people that really enjoys seeing free, open source software libraries choke, type in “the day after tomorrow” to get your jollies.

Similar tools include Simon Willison’s “better way of entering dates,” but Datejs trumps that and others with its speed and internationalization features.

PHP programmers have the incredibly handy strtotime which handles a variety of string inputs on the server side, so they might not as enthused about Datejs, but for the rest of us, this provides a simple way to give your visitors a near infinite range of date input options and all it takes is adding a single line of code to your page.

Plus the site has a great ninja logo, what more do you want?

[via Ajaxian]

See Also:

Post Comment Comments Permalink Print
Reddit Digg

 
Subscribe now

Special Offer For Webmonkey Users

WIRED magazine:
The first word on how technology is changing our world.

Subscribe for just $10 a year