javascript - Momentjs firstday of week -


I'm using momentJs I would like to change the first day of the week on Monday and somehow it will work.

moment.locale ('n', {week: {DOE: 1 // the first day of Monday week}});

If I moment () Type 'StartOf' format ('DDD-MM-YYYY') , this "Monday 19-01-2015"

But if I moment () Year (2014) .week (4) .days (0) , then it will be shown as "Sunday 18-01 -2015"

Nobody knows that this Why got the problem?

day function locale is not aware it is always Sunday as day 0 uses it.

Use the weekday function instead - the locale is aware.

See the document and, which explain it very well.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -