What is it for?
Closed this issue · 7 comments
I guess it should be defaults[0] = defaults[0].replace(/(\d+)(th|rd|nd|st)/, '$1');
??
Why do you think that? Do you have an example? If so: can you provide it in a Pull Request?
by the regular expression, it seems that it aims at removing the ordinal suffixes after a number. e.g. 1st 2nd 3rd 4th ...
I am not really sure about it. Any advise?
by the regular expression, it seems that it aims at removing the ordinal suffixes after a number. e.g. 1st 2nd 3rd 4th ...
indeed, but what values (defaults
) could be used as input? No idea how this part works and whether "rd" would be a string that is used...
Also see #6
After some more study on the code, I believe that it purposely support Do
in the format string such that, for example: DDo MMM YYYY
will be temporarily stored in ___format
and is replaced to DD MMM YYYY
. It then remove all possible ordinal suffixes, i.e. st, nd, rd and th, so that the format string works as normal cases.
Mm, ok, any more information in this Do
formatting part? Can't find anything quickly...
http://www.mattkruse.com/javascript/date/
I am hesitant in changing / fixing stuff that we do not completely understand and is not broken.
@holtkamp you're right, just keep it as an information in case it breaks after years.
and, information for who may visit here.
Do
formating is supported in moment
https://momentjs.com/docs/
Thanks for understanding! Closing issue