Closed brunomacf closed 10 years ago
Usually the /
is used in the US as separator in the date, which has the Month-Day-Year order. For Day-Month-Year, use .
as separator. Is that not the convention where come from?
I'm from Brazil and here the convention is DD/MM/YYYY
Good to know, cheers! I'll add an additional check if the day
part is > 12 and if yes, I'll swap the order. It's not a bullet proof solution, but better than nothing I guess.
It could be beneficial to check for the country or region before the script decides which method to favor. I believe it is mostly the US that puts the month first, whereas the UK and AU put the day first.
By collecting information on how different areas show their dates, you could group the logic that way. You can also provide an option for explicitly stating the region. I think this would provide for a very intuitive user experience.
this is fixed via 491494e.
It could be beneficial to check for the country or region before the script decides which method to favor
I agree. But I'd leave that to another library. It could determine the preferred order and pass it as preferredOrder
option
moment.parseFormat('15/05/1987')
parsed toMM/DD/YYYY
, I expected:<please fill in>
The correct would be DD/MM/YYYY!!