Given the text box, I want to have a suitable placeholder. A typical placeholder would be something like: "mm / dd / yyyy".
However, I would like to use dates corresponding to the language values using the moment.js function.
This means that I will specify “l” as the date.js format, but can I define a date format that will use the .js moment in this case?
The user will not understand what “l” means, so using this value in the placeholder text makes little sense.
In particular, I hope to access something like the internal "defaultLongDateFormat". (Although this is just the default value - moment.js probably updates it or has some other run-time mapping for the date formats available for the locale - I would like to access this mapping.)
EDIT:
There are several downvotes (which do not explain why they reduce it).
I think this is because they do not understand the question, so here are a few examples:
I need a function such that: getFormat ("l") → "mm / dd / yyyy" or the equivalent for US locales. getFormat ("l") → "dd / mm / yyyy" or the equivalent for AU locales.
I don’t want to format the given date or analyze a specific date - I just want to define it in a user-friendly format, taking into account the format last.js in the format of arguary, in particular, for “l”.
source share