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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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.