Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix(date): date filter now correctly formats high precision date-times #2280

Closed
wants to merge 3 commits into from

Conversation

kevin-wells-iq4bis
Copy link
Contributor

Fix the date filter so fractional seconds are processed correctly. For example {{2003-09-10T13:02:03.987654Z | date: yyyy-mm-dd ss}} is now formatted as 2003-09-10 03. Prior to this fix it was formatted as 2003-09-10 30 because the code treated .987654 as 987.654s / 60s = 16 minutes 27.654 seconds so 27 seconds were added to the second component of the date.

The fractional seconds are rounded to the nearest millisecond.

I've also fixed a couple of tests so they work correctly when they are run in any time zone. I tested them in UTC+1300.

See:

This date {{2003-09-10T13:02:03.123456Z | date: yyyy-mm-dd ss} is now
treated as having 123.45ms. Previously it had 123456ms so 123 seconds
were added to the formatted date.
@petebacondarwin
Copy link
Contributor

  • Contributor signed CLA now or in the past (if you just signed, leave a comment here with your real name)
  • PR doesn't introduce new api
  • PR doesn't contain a breaking change
  • PR contains unit tests
  • PR contains e2e tests (if suitable)
  • PR contains documentation update (if suitable)
  • PR passes all tests on Travis (sanity)
  • PR passes all tests on ci.angularjs.org (cross-browser compatibility)
  • PR is rebased against recent master
  • PR is squashed into one commit per logical change
  • PR's commit messages are descriptive and allows us to autogenerate release notes (required commit message format)
  • All changes requested in review have been implemented

@petebacondarwin
Copy link
Contributor

@kevin-wells-iq4bis - have you signed the CLA?
CI server checks looks green: http://ci.angularjs.org/job/angular.js-pete/144/console

@kevin-wells-iq4bis
Copy link
Contributor Author

I submitted an individual CA using the Sign the Form Electronically method: https://developers.google.com/open-source/cla/individual

I can submit it again if you have no record of this.

Thanks,
Kevin Wells

@petebacondarwin
Copy link
Contributor

Squashed and merged at 4f2e360. Thanks!

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

Successfully merging this pull request may close these issues.

2 participants