Is there a way to get the date format of the client through javascript?
Printable View
Is there a way to get the date format of the client through javascript?
I don't know of any way to return the format used. I believe that Javascript only has methods to get and set date values, not to directly return the format. I suppose it wouldn't be too hard to write a function that does this yourself parsing the string returned from the toLocaleString() method and comparing it against the different formats that you are after.
On second thought, it might be kind of difficult...
:eek2:
toLocaleDateString();
I thought that he was after the "mm/dd/yyyy" type kind of format returned as a string? Anyway, thanks for posting that version. It's a lot easier to use instead of parsing out the time, the way I originally was.
:)
Exactly. What I'm trying to accomplish in the long run is sort of a mask edit box for date entry, so I need to be able to figure out the format in order to come up with the mask.Quote:
Originally Posted by Psyrus
Unless someone can think of a better way.
:afrog:
Forget masking. Use 2 textboxes and a combobox like normal people.
Have we met? :wave:Quote:
Originally Posted by mendhak
I'll probably settle for dropdown box approach, just trying to appease my audience.
Excellent choice. I'll have PeeWee Herman bring in the check.