Closed diesieben07 closed 11 months ago
Looks really good. Left one comment
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 🚀
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
.