Title: feat(common/datePipe):fix date formatter correct pattern сloses #7008 by laskoviymishka · Pull Request #8154 · angular/angular · GitHub
Open Graph Title: feat(common/datePipe):fix date formatter correct pattern сloses #7008 by laskoviymishka · Pull Request #8154 · angular/angular
X Title: feat(common/datePipe):fix date formatter correct pattern сloses #7008 by laskoviymishka · Pull Request #8154 · angular/angular
Description: Please check if the PR fulfills these requirements The commit message follows our guidelines: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit-message-format Tests for the changes have been added (for bug fixes / features) Docs have been added / updated (for bug fixes / features) What kind of change does this PR introduce? (Bug fix, feature, docs update, ...) Fix for issue when date pipe not correctly formatted, closes #7008 add regular expression to parse date parts add date part creator function replace tokens in pattern to parsed parts What is the current behavior? (You can also link to an open issue here) See plnkr: http://plnkr.co/edit/nNpBNaB8z7DEnZdpj7gM?p=preview Currently formatter only looking on your locale and what you pass in pattern string not how (MM dd yyyy and dd MM yyyy is really same pattern for him). It have no affect to any formatting inside this pattern. In a fact it strongly coupled to https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat global object. What is the new behavior (if this is a feature change)? We parse pattern to date token, which materialized according to passed date and current locale (with DateTimeFormat global object as well). After parsing and materializing date parts we replace tokens to materialized parts. See plnkr: http://plnkr.co/edit/BVfVx27Ko76PQPOu8Xl7?p=preview There is new version of date pipe that show how new formatter works Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?) no Other information:
Open Graph Description: Please check if the PR fulfills these requirements The commit message follows our guidelines: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit-message-format Tests for the ch...
X Description: Please check if the PR fulfills these requirements The commit message follows our guidelines: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit-message-format Tests for the ch...
Opengraph URL: https://github.com/angular/angular/pull/8154
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:ebdce0e2-6a19-f3da-0a43-2aeadc7a9973 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E0E4:1C94F:118FC49:166B6B6:6B015C9D |
| html-safe-nonce | e83b019ff9a5d55060ebba4255347593d33a483699aa1c08c83281b911da751a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMEU0OjFDOTRGOjExOEZDNDk6MTY2QjZCNjo2QjAxNUM5RCIsInZpc2l0b3JfaWQiOiI0NzYyNjkyNTY5MjI0MjczMDUzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ef469d5808f9c37e3ed6c6f21a23d0207348a0d8c99d462971ba94e1665d8765 |
| hovercard-subject-tag | pull_request:67181427 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/angular/angular/pull/8154/files |
| twitter:image | https://avatars.githubusercontent.com/u/2754361?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/2754361?s=400&v=4 |
| og:image:alt | Please check if the PR fulfills these requirements The commit message follows our guidelines: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit-message-format Tests for the ch... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width