Manipulating dates without using the javascript date object

24 views
Skip to first unread message

amplegamble

unread,
Oct 23, 2009, 8:05:33 AM10/23/09
to Datejs - A JavaScript Date Library
It appears I can't use the javascript Date object as it inherintly
defaults to US dates when you initialise with a datestring. There is
no way of passing any culture information to the date object

I.e. No matter what the clients locale settings are

var d = new Date("08/10/2009") will always create a date object
representing the 10th August 2009 rather than the 8th October 2009 if
the clients locale was the UK.

Given 2 date strings I need to create 2 date objects so I can do
things like add/subtract number of days from each easily. I came
across Datejs and having had a quick look at the documentation it
seems pretty powerful.

With Datejs can I initialise a date object with a datestring and the
format it is or better still does the constructor do this by default.

B
Reply all
Reply to author
Forward
0 new messages