Sugar
Sugar copied to clipboard
Possible issue in Italian date parsing
Hi, in Italian dates, one may reference "next Monday" as "lunedì prossimo" (where "prossimo" is the translation of "next"), but, using the Italian locale:
- "lunedì prossimo" is parsed as Invalid Date;
- "prossimo lunedì" is parsed correctly, while its use is very uncommon;
I've modified my locales/it.js
file to correctly parse this format. I can't understand the
difference between timeParse
and timeFrontParse
, so I've added a format to both.
timeParse: [
'{shift?} {day|weekday}',
'{weekday} {shift}', // <--- line added
'{weekday?},? {date} {months?}\\.? {year?}'
],
timeFrontParse: [
'{shift?} {day|weekday}',
'{weekday} {shift}', // <--- line added
'{weekday?},? {date} {months?}\\.? {year?}'
]
I might send a PR for this.
Thanks,
Really sorry about how long this has taken... probably not going to help you anymore but hopefully it will help someone....