andrewplummer / Sugar

A Javascript library for working with native objects.
https://sugarjs.com/
MIT License
4.53k stars 306 forks source link

Possible issue in Italian date parsing #591

Open lusentis opened 7 years ago

lusentis commented 7 years ago

Hi, in Italian dates, one may reference "next Monday" as "lunedì prossimo" (where "prossimo" is the translation of "next"), but, using the Italian locale:

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,

andrewplummer commented 6 years ago

Really sorry about how long this has taken... probably not going to help you anymore but hopefully it will help someone....