parseExact - please forgive me the missing leading zeroes

85 views
Skip to first unread message

pihentagy

unread,
Oct 4, 2010, 11:14:02 AM10/4/10
to Datejs - A JavaScript Date Library
Hi!

I've found this cool library today.

However, here is my question.

It is true, that if I tell the format 'HH:mm', and I would like to
parse a time like '2:3', they did not match, but I'd like to solve my
problem:

I am using client-side formatting and parsing from db to GUI syntax,
and if the user happens to enter '2:3', I don't want to reject it just
because of the missing leading zero...

OTOH the time and date format should be configurable. I know I can
solve it with supplying an array of all combinations of leading zeros
switched on and off, but that is not so elegant (and may be too
complicated(.

Is there an easier solution?

thanks
Gergo

Chris Pratt

unread,
Oct 6, 2010, 1:26:56 PM10/6/10
to dat...@googlegroups.com
Use H:m
  (*Chris*)


--
You received this message because you are subscribed to the Google Groups "Datejs - A JavaScript Date Library" group.
To post to this group, send email to dat...@googlegroups.com.
To unsubscribe from this group, send email to datejs+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/datejs?hl=en.


Reply all
Reply to author
Forward
0 new messages