Skip to content
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

minimalDays #86

Open
sffc opened this issue Jul 29, 2024 · 8 comments
Open

minimalDays #86

sffc opened this issue Jul 29, 2024 · 8 comments

Comments

@sffc
Copy link
Contributor

sffc commented Jul 29, 2024

There were some potential concerns raised in the CLDR Design WG regarding minimalDays. Do we want to hold it back from Intl Locale Info?

@macchiati @markusicu @FrankYFTang

@FrankYFTang
Copy link
Collaborator

could you include the CLDR ticket here?

@sffc
Copy link
Contributor Author

sffc commented Aug 22, 2024

@FrankYFTang
Copy link
Collaborator

From https://unicode-org.atlassian.net/browse/CLDR-17095 this seems a non issue

@sffc
Copy link
Contributor Author

sffc commented Dec 19, 2024

Have been waiting for confirmation from the Google Calendar team for a while.

@FrankYFTang
Copy link
Collaborator

FrankYFTang commented Dec 19, 2024

https://unicode.org/reports/tr35/tr35-dates.html#Week_Data

In order for a week to count as the first week of a new year for week-of-year calculations, the week beginning with firstDay must include at least the number of days in the new year specified by the minDays value; otherwise the week will count as the last week of the previous year (and for week-of-month calculations, minDays also specifies the minimum number of days in the new month for a week to count as part of that month).

Therefore, minDays is used to calcuate two information:

  • the minimum number of days in the new year for a week to count as part of that year.
  • the minimum number of days in the new month for a week to count as part of that month.

Now, why do we care which week is in which year or month?

Use case 1: AIDS Awareness Week

AIDS Awareness Week is last week in November, when extra effort is made to raise AIDS awareness.
https://en.wikipedia.org/wiki/AIDS_Awareness_Week

The "the last week in November" is therefore the week before "the first week in December" which depends on minDays.

Use case 2 National Map Reading Week

https://en.wikipedia.org/wiki/National_Map_Reading_Week
National Map Reading Week is an awareness campaign originally created by the Ordnance Survey, Britain's National Mapping Agency. It runs annually in the third week of October.

"the third week of October." is therefore two week after "the first week of October" which depends on minDays.

Use case 3: OCD Awareness Week

OCD Awareness Week ... takes place in the second week of October each year
https://en.wikipedia.org/wiki/OCD_Awareness_Week

"the second week of October" is therefore the week after "the first week of October" which depends on minDays.

Use case 4: World Immunization Week

World Immunization Week is a global public health campaign to raise awareness and increase rates of immunization against vaccine-preventable diseases around the world. It takes place each year during the last week of April

https://en.wikipedia.org/wiki/World_Immunization_Week
"The last week of April" is therefore the week before "the frist week of May" which depends on minDays.

@FrankYFTang
Copy link
Collaborator

the value is different per locale, not just calendar

(new Intl.Locale("en-US")).getWeekInfo().minimalDays
1
(new Intl.Locale("en-GB")).getWeekInfo().minimalDays
4
(new Intl.Locale("fr")).getWeekInfo().minimalDays
4
(new Intl.Locale("zh-CN")).getWeekInfo().minimalDays
1
(new Intl.Locale("de-DE")).getWeekInfo().minimalDays
4
(new Intl.Locale("es-MX")).getWeekInfo().minimalDays
1
(new Intl.Locale("es-ES")).getWeekInfo().minimalDays
4
(new Intl.Locale("en-CA")).getWeekInfo().minimalDays
1
(new Intl.Locale("ja-JP")).getWeekInfo().minimalDays
1

Therefore, "the Xth week of Month Y" could be a different week between US and UK.
because of this. In order for anyone to calculate which date is considered as the Xth week of Month Y for locale Z, the computation will need this value from locale Z.

@FrankYFTang
Copy link
Collaborator

So the first week of November 2024
in US is
October 27, Sunday - November 2, Saturday 2024
in France is
November 4, Monday - November 10, Monday 2024
and this calculation need both the firstDayOfWeek and also minDay to calculate

@sffc
Copy link
Contributor Author

sffc commented Dec 21, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants