Resend - Possible bug with week number parsing?

42 views
Skip to first unread message

Knoxville1356

unread,
Nov 1, 2010, 7:29:53 PM11/1/10
to Datejs - A JavaScript Date Library
(I tried submitting this earlier, but don't think it worked, so trying
again. Sorry if this ends up doubleposting)

I'm trying to parse a data source that uses week numbers.
W01
W02
W03
etc.

Date.parse("W01") handles this fine for the current year.

However, some of the data I have is for last year. So e.g. week number
52 (which is the end of 2009) shows up as the end of 2010 (in the
future).

I have tried to add 'year' to the input data, but this does not seem
to work at all.

E.g. Date.parse("W52 2009") does not work. Neither does
Date.parse("W50" "2009") or any other similar way of defining a
specific year.

Is this a bug, or is there a specific format I need to use in order to
parse a week number from a specific year?

Kind regards
John
Reply all
Reply to author
Forward
0 new messages