Converting number to date format
I'm not too sure how to approach this but I have a date input that uses a jQuery pop-up for a calendar, and enters the date in a format d MMM yy (1 Jan 11).
Not everyone wants to be clicking and choosing the date from the calendar but to be entering it just as a number such as 0101, 010111 or 01012011 which can be faster. This would then need to be converted to the d MMM yy format as per the jQuery pop-up when they exit the input box.
So really only if it's a number format it needs to look at the number of digits... and does the conversion.
Has anyone done something like this before? Or is there a link to how I could go about achieving this?
You _could_ go to the trouble of trying to test for which format the user is entering and then setting up several different formatting options depending upon input, but it would be kind of a pain.
What about just checking to make sure that the user enters nn mmm yy format? You can do that with Regular Expression. Simple.
Thanks for the reply.
The input is used within dataentry so it's not so much for forcing the entry type but to allow them to enter the date in other ways if they prefer.
Unfortunatley having validation on this would be more of a nuisance than a help.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)