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

fix(common): date pipe is giving error weeks #37632

Closed
wants to merge 3 commits into from

Conversation

@ajitsinghkaler
Copy link
Contributor

@ajitsinghkaler ajitsinghkaler commented Jun 18, 2020

DDtae pipe is giving wrong week number made a change that will return correct week numbers for ifferent years

Fixes #33961

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@pullapprove pullapprove bot requested a review from AndrewKushnir Jun 18, 2020
@ajitsinghkaler ajitsinghkaler marked this pull request as draft Jun 18, 2020
@ajitsinghkaler ajitsinghkaler marked this pull request as ready for review Jun 18, 2020
@ajitsinghkaler
Copy link
Contributor Author

@ajitsinghkaler ajitsinghkaler commented Jun 18, 2020

@AndrewKushnir flaky failures on ci

Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Hi @ajitsinghkaler, thanks for the fix 👍

I've left a couple comments, please have a look when you get a chance.

FYI I've added the "breaking change" label to this PR. Even though it's a bug fix, it changes the behavior that other developers may rely on.

I'd also like to ask @petebacondarwin to have a look at this change as I'm not super familiar with this code and having additional reviewer would be very helpful.

Thank you.

packages/common/src/i18n/format_date.ts Outdated Show resolved Hide resolved
packages/common/test/pipes/date_pipe_spec.ts Show resolved Hide resolved
Date pipe is giving wrong week number when used with the date format 'w'. If first week(according to Iso)  has some days in previous year

Fixes angular#33961
Copy link
Member

@petebacondarwin petebacondarwin left a comment

Thanks for this fix. It appears to be correct.
I suggest a refactoring that would be less code and a bit simpler.

packages/common/src/i18n/format_date.ts Outdated Show resolved Hide resolved
Copy link
Member

@petebacondarwin petebacondarwin left a comment

LGTM

@AndrewKushnir
Copy link
Contributor

@AndrewKushnir AndrewKushnir commented Jun 22, 2020

FYI I've started presubmit (+ global one) in Google's codebase, will let you know the result as soon as I have it. Thank you.

Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Thanks for the fix @ajitsinghkaler 👍

@AndrewKushnir
Copy link
Contributor

@AndrewKushnir AndrewKushnir commented Jun 23, 2020

Hi @ajitsinghkaler, just want to give a quick update. Running tests in Google's codebase didn't indicate any issues, which is great. Also given the fact that this is a bug fix with low risk, I'm removing the "breaking changes" flag. In any case, since the behavior of the framework changes slightly (to become more accurate), we would merge it to master only and it will be released as a part of the next minor version (v10.1.0). Thank you.

@ajitsinghkaler ajitsinghkaler deleted the date-pipe branch Jun 26, 2020
@angular-automatic-lock-bot
Copy link

@angular-automatic-lock-bot angular-automatic-lock-bot bot commented Jul 27, 2020

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jul 27, 2020
profanis added a commit to profanis/angular that referenced this issue Sep 5, 2020
Date pipe is giving wrong week number when used with the date format 'w'. If first week(according to Iso)  has some days in previous year

Fixes angular#33961

PR Close angular#37632
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants