-
Notifications
You must be signed in to change notification settings - Fork 729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement localized week information #1454
Merged
icambron
merged 29 commits into
moment:master
from
diesieben07:feature/locale-week-start
Oct 12, 2023
Merged
Implement localized week information #1454
icambron
merged 29 commits into
moment:master
from
diesieben07:feature/locale-week-start
Oct 12, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
icambron
reviewed
Jun 23, 2023
Looks really good. Left one comment |
Adjust localWeekDay to be in line with weekday
…alculations based on locale week settings
…weeksInLocalWeekYear
After a lot of work, this is now ready for review. All features I wanted to add have been implemented, including tests. |
This is great. Merging as-is. |
Hey! Any Idea when will this be released at npm? @icambron Amazing work btw 🚀 |
jackkoppa
added a commit
to jackkoppa/DefinitelyTyped
that referenced
this pull request
Jan 4, 2024
Covers changes added in this luxon PR: moment/luxon#1454
Closed
8 tasks
jackkoppa
added a commit
to jackkoppa/DefinitelyTyped
that referenced
this pull request
Jan 4, 2024
Covers changes added in this luxon PR: moment/luxon#1454
jackkoppa
added a commit
to jackkoppa/DefinitelyTyped
that referenced
this pull request
Jan 4, 2024
Covers changes added in this luxon PR: moment/luxon#1454
jackkoppa
added a commit
to jackkoppa/DefinitelyTyped
that referenced
this pull request
Jan 4, 2024
Covers changes added in this luxon PR: moment/luxon#1454
jackkoppa
added a commit
to jackkoppa/DefinitelyTyped
that referenced
this pull request
Jan 4, 2024
Covers changes added in this luxon PR: moment/luxon#1454
typescript-bot
pushed a commit
to DefinitelyTyped/DefinitelyTyped
that referenced
this pull request
Jan 5, 2024
* Add missing opts + useLocaleWeeks param to luxon methods Covers changes added in this luxon PR: moment/luxon#1454 * Rename BaseComparisonOptions to be a more private helper * Add new luxon Info methods for weekdays * Add new weekday functionality to DateTime * Update luxon version to match latest NPM publish --------- Co-authored-by: Jack Koppa <hello@jackkoppa.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Use
Intl.Locale#getWeekInfo
to provide locale-dependent week information, such as the start of the week.Fixes #1447
Current status:
Info.features
reports on whether localized week info is available in the current environmentInfo.getStartOfWeek
: returns 1 (Monday) through 7 (Sunday) for first day of the week according to localeInfo.getMinimumDaysInFirstWeek
for getting minimum days in the first week of the yearInfo.getWeekendWeekdays
for getting weekend daysDateTime#isWeekend
: returns whether the current date is on the weekend according to the localeDateTime#localWeekday
: returns 1-7 for first to last day according to localeDateTime#localWeekNumber
andDateTime#localWeekYear
; same as weekNumber and weekYear, but respecting the locale. I need to understand the math here before I can implement it.DateTime#hasSame
,DateTime#startOf
,DateTime#endOf
andInterval#count
accept a new optionuseLocaleWeeks
, when enabled theweek
unit will act according to the locale week informationnumberingSystem
.DateTime.fromObject
andDateTime#set
DateTime#weeksInLocalWeekYear
, analogous toweeksInWeekYear
localWeekNumber
andlocalWeekYear
.