question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ISO weeks (start from monday)?

See original GitHub issue

There are some handy methods in moment.js like .startOf('isoWeek'), .isoWeekday(1). They are very useful when Monday is the first day of week in current locale.

I didn’t found any similar methods, are they exists?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:32 (16 by maintainers)

github_iconTop GitHub Comments

31reactions
dantodevcommented, Mar 10, 2019

I found 2 solutions to override the weekStart globally (per locale). I don’t know if this is the best way but maybe this helps somebody else too:

Solution 1:

import 'dayjs' from 'dayjs';
dayjs.Ls.en.weekStart = 1;

Solution 2:

import 'dayjs' from 'dayjs';
import en from 'dayjs/locale/en';
dayjs.locale({
    ...en,
    weekStart: 1,
});
11reactions
kvolkovich-sccommented, Aug 6, 2018

Any news here?

Read more comments on GitHub >

github_iconTop Results From Across the Web

ISO week date - Wikipedia
Weeks start with Monday and end on Sunday. Each week's year is the Gregorian year in which the Thursday falls. The first week...
Read more >
ISO week date | Calendar Wiki - Fandom
Weeks start with Monday. ISO years have a year numbering which is approximately the same as the Gregorian years, but not exactly (see...
Read more >
About the ISO Week Date Calendar
All 52 or 53 weeks of the year receive a number, with days of the week numbered 1 through 7, beginning with Monday....
Read more >
How Do Week Numbers Work? - Time and Date
The most common is the International Standard ISO 8601, where Monday is the first day of the week followed by Tuesday, Wednesday, Thursday,...
Read more >
What is the First Day of the Week? - Calendarr
Monday is the first day of the week, according to the international standard for the representation of dates and times ISO 8601. However,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found