StartOf('week') always return Monday
See original GitHub issueI been creating a calendar by using date from luxon. My calendar has a feature to change the background of each date box if it .hasSame(d, 'weeks')
return true. let say today is 18 May my expectation when I call hasSame(d, 'weeks')
is to return true on 16 May to 22 May but actual is 17 May to 23 May have been highlighted.
Anyone can help me to correct the result and what API should I call. I been tried .set({{ weekday: 7})
still got a same result
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Starting the week on Monday with isoWeekday()
startOf ('week') returns Sunday (of the past Week) and setting it then to Monday sets it one week to early. – Christian. Feb...
Read more >How to find beginning/start of week by any given date in Excel?
(1) This formula =A2-MOD(A2-2,7) will return Monday as the beginning of week based on the given date. For returning Sunday as the start...
Read more >Get Monday of the week - Excel formula | Exceljet
WEEKDAY returns a number, normally 1-7 for each day of the week. By setting the optional second argument (return_type) to 3, WEEKDAY will...
Read more >M language - Start of week is Sunday not Monday - Query Editor
StartOfWeek ([Date],firstDayofWeek), type date). I want to change it to recognise Sunday as the first day of the week instead of Monday.
Read more >Date & Time Functions - Snowflake Documentation
As defined in the ISO 8601 standard (for dates and time formats), ISO weeks always start on Monday and “belong” to the year...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Luxon uses the ISO week calendar, where weeks start on Monday.
We’d love to support local weeks, but the Intl API doesn’t currently have the ability to tell us when, say, Germany starts its weeks. The relevant proposal is here: https://github.com/tc39/proposal-intl-locale-info
That’s clearly not the case. In Germany week starts on Monday, according to standard EN 28601 which is according to ISO 8601. But it also shows, this is not a trivial topic.