Very Nice, But America Is Not The World!

15 views
Skip to first unread message

Thomas David Baker

unread,
Nov 28, 2007, 6:10:28 AM11/28/07
to Datejs - A JavaScript Date Library
PHP spoilt me and now I think all langauges should have a library like
this. Very nice.

Is there any way to make it understand that America is not the world
and that 5/6 is almost always the 5th June not the 6th May?
Message has been deleted

Geoffrey McGill

unread,
Nov 28, 2007, 6:24:45 AM11/28/07
to dat...@googlegroups.com
The library includes support for 150+ cultures. Each CultureInfo file
has a setting for the parser to determine the DateElementOrder (eg. mdy
vs. dmy vs. ymd).

Basically all you have to do is include one of the pre-compiled
culture-specific versions instead of the root date.js file and the
Parser will take care of the rest.

For example, we're in Canada and the typical short date format in Canada
is dd/MM/yyyy. We include the date-en-CA.js file into all our web apps.

Example

<script type="text/javascript" src="date-en-CA.js"></script>

All the pre-compiled culture-specific date.js files are located within
the /trunk/build/ directory.

The none minified source CultureInfo files are located within the
/trunk/src/globalization/ directory.

The following "Getting Started with Datejs" blog post contains more
useful information about the CultureInfo files. See
http://www.datejs.com/2007/11/27/getting-started-with-datejs/

Hope this helps.

Reply all
Reply to author
Forward
0 new messages