Allowing only future dates?

19 views
Skip to first unread message

Erv

unread,
Nov 30, 2009, 12:41:46 PM11/30/09
to Datejs - A JavaScript Date Library
I have a scenario where datejs is parsing dates from a field that
conceptually will only ever have future dates in it. Is there a way
to give a hint to .parse() to tell to expect future dates? For
example, if today is a 12/2/09 (a wednesday) and someone types
"Tuesday", it would parse into 12/8/09. Also, if someone types in
"1/21", it would parse into 1/21/2010 (since 1/21/2009 is in the past).

infringer

unread,
Dec 16, 2009, 11:39:38 AM12/16/09
to Datejs - A JavaScript Date Library
I would love something like this as well. I actually hacked the code
to do this. But it had an ill effect. A user could not manually
enter a year.

So today is 12/16, if you user enters 12/17 it shows up as 12/17/09,
but if they user enters 12/15 it shows up as 12/15/10. If the users
enters 12/15/09 it showed up as 12/15/10.

Haven't been able to figure it out.
Reply all
Reply to author
Forward
0 new messages