question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add format of ISO week-numbering year

See original GitHub issue

πŸš€ feature request

Relevant Package

This feature request is for @angular/common

Description

formatDate(new Date(2018, 11, 31), 'yyyy-ww', 'en-US')
// 2018-01

Week is right but year is wrong.

Describe the solution you’d like

Add an ISO week-numbering year like rrrr.

formatDate(new Date(2018, 11, 31), 'rrrr-ww', 'en-US')
// 2019-01

Here is the reference of date-fns.

Describe alternatives you’ve considered

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
petebacondarwincommented, Oct 30, 2020

@prashanttholia - sorry for not replying sooner. We discussed this and felt it would be better to go with the Y formatting character rather than r. I know that you are keen to help out in this but since we are really close to final release of 11.0.0, @AndrewKushnir went ahead and created a PR to fix this up in https://github.com/angular/angular/pull/39495. Thank you for the original PR.

(We need to work out what to do about ISO alignment for weeks etc too.)

(Also thanks to @cexbrayat for pinging me about this outstanding question!)

1reaction
petebacondarwincommented, Sep 10, 2020

@prashant-tholia - great! Please make sure you have read https://github.com/angular/angular/blob/master/CONTRIBUTING.md. The PR will need to include unit tests and documentation before it can be merged.

Let me know if you need help getting started.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ISO week date - Wikipedia
An ISO week-numbering year (also called ISO year informally) has 52 or 53 full weeks. That is 364 or 371 days instead of...
Read more >
ISO Date Representatation and Week Numbering
The week numbering algorithm looks strange. It means that Week 1 will not start on 1st January. ... or 53 may extend into...
Read more >
ISO Week Number Calculation - Claris - FileMaker Pro
This function was designed to identify the fiscal year for calendar dates, and meet The International Organization for Standardization (ISO) week-numbering ...
Read more >
ISO-8601 Week-Based Calendar - Tableau Help
ISO -8601 calendars divide dates into Years, Quarters, Weeks, and Week Days. ... For example, adding one month to an ISO-8601 date will...
Read more >
How Do Week Numbers Work? - Time and Date
The weeks of the year in a Gregorian calendar are numbered from week 1 to week 52 or 53, depending on several varying...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found