1

I am working on a web-based application that will require users to enter a start and end time

I find selection boxes annoying for that purpose, and I am looking for any javascript functions that will interpret most entries that a user could put for example:

1p, 1pm, 1:00pm, 13, 13:00 would all be 1:00PM

I know I can write it, but if someone has already written a comprehensive one, it would be appreciated.

Thanks,

2
  • @Anurag: why don't you add that as an answer? Commented Dec 21, 2011 at 22:05
  • @JoeriSebrechts - good idea, will do. Commented Dec 22, 2011 at 3:15

1 Answer 1

1

Checkout Date.JS. The sample parser on their website correctly parses all the formats you have listed except 13, which it considers to be the date and parses as Dec 13 instead of 1PM.

Sign up to request clarification or add additional context in comments.

2 Comments

thanks...I checked it out, but it doesn't really suit my needs...a bit too robust
for anybody interested in using datejs for this purpose, this post may help you stackoverflow.com/questions/4012702/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.