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

Add YearWeek like YearMonth ? #255

Closed
hlehmann opened this issue Nov 5, 2019 · 5 comments
Closed

Add YearWeek like YearMonth ? #255

hlehmann opened this issue Nov 5, 2019 · 5 comments
Assignees

Comments

@hlehmann
Copy link

hlehmann commented Nov 5, 2019

Simple suggestion : add a YearWeek like we have a YearMonth.

Thinking in terms of weeks is very useful in many tools, calendars, workflows...

A YearWeek could easily be represented by a Date of the first day of the week, like a YearMonth could easily be represented by a Date of the first day of the month.

But as we have a YearMonth what about a YearWeek ?

Since date.weekOfYear is available, we could have a date.getYearWeek() and it could be represented in string with "2019W45".

@pipobscure pipobscure self-assigned this Nov 12, 2019
@sffc
Copy link
Collaborator

sffc commented Nov 14, 2019

FYI, CLDR has the data to format this, so there's no blocker from the Intl perspective.

I do want to point out that java.time has YearMonth and MonthDay, but not YearWeek, so leaving out YearWeek would not constitute a lack of a feature relative to at least one other major programming language.

@littledan
Copy link
Member

Although this has some meaning, we ultimately have to be a bit selective in the set of types we include in the first release of Temporal. I'd argue that we should omit YearWeek at first, and consider adding it in a Temporal v2.

@pipobscure
Copy link
Collaborator

I'd suggest we close this and accept #264 instead.

@ptomato
Copy link
Collaborator

ptomato commented Apr 2, 2020

We discussed today that the feature set that we want to move forward with is known, and there's been no activity on this for a long time. Closing.

@ptomato
Copy link
Collaborator

ptomato commented Feb 12, 2021

I've added this for discussion in Temporal V2: js-temporal/proposal-temporal-v2#11

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

5 participants