jefbarn / moment-recur-ts

Conversion of the moment-recur library into TypeScript.
MIT License
16 stars 7 forks source link

Incorrect behavior with Monday as first week day #38

Open Sinled opened 6 years ago

Sinled commented 6 years ago

May be i am doing something wrong, but the same code

moment.recur({
  start: '2019-03-01',
  end: '2019-04-01',
})
.every([0, 1, 2, 3, 4, 5, 6]).daysOfWeek()
.every([0]).weeksOfMonthByDay()
.all('YYYY-MM-DD')

gives two different results, with default locale settings :

["2019-03-01", "2019-03-02", "2019-03-03", "2019-03-04", "2019-03-05", "2019-03-06", "2019-03-07", "2019-04-01"]

and with specified Monday as first week day

moment.locale('en', { week: { dow: 1 } })
["2019-03-01", "2019-03-02", "2019-03-04", "2019-03-05", "2019-03-06", "2019-03-07", "2019-04-01"]

2019-03-03 - is missing from results