Date/time short format display in Safari
See original GitHub issueHello all,
Thanks for your great library.
I’m submitting a…
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:
Current behavior
When formatting with translocoDate: { dateStyle: 'short', timeStyle: 'short' }
, I get different results between Chrome/Firefox/Edge and Safari. In Safari, the time is omitted.
Minimal reproduction of the problem with instructions
I’ve put together a stackblitz project to demonstrate, forked from your excellent example project:
What is the motivation / use case for changing the behavior?
I’m currently developing a SPA app and need it to display consistently on Android and iOS.
Environment
Angular version: 9 (@latest)
Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [x] Safari (desktop) version XX
- [x] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: v10.15.3 (locally)
- Platform: (Mac, Windows)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Change how dates, times, and more display on Mac
Change how dates, times, and more display on Mac · On your Mac, choose Apple menu > System Settings, click General in the...
Read more >Safari JS cannot parse YYYY-MM-DD date format?
With Safari 4/5 (on Mac OSX) the Javascript fails to parse dates of the format YYYY-MM-DD , returning NaN instead of the expected...
Read more >Javascript and Safari Date format - Burningthumb Studios
Update: Apple replied to my bug report about Javascript and the Safari Date format saying that this issue is fixed in the latest...
Read more >Intl.DateTimeFormat.prototype.formatRange() - JavaScript | MDN
formatRange() formats a date range in the most concise way based on the locale and ... JavaScript Demo: Intl.DateTimeFormat.prototype. ... Safari on iOS14.5....
Read more >How to Change the Date Format on a Mac - wikiHow
1. Click the Apple icon. It's the Apple logo at the top left corner of the menu bar. 2. Click System Preferences. 3....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I encountered the same problem even in the latest versions of Safari (14.0). The solution is not to use the shorthand format style notations:
'short'
,'medium'
,'long'
and instead explicitly set hour, minute, second, day, month etc.For example, instead of using
{ dateStyle: 'short' }
you should declare it as:If you stick to the full notation you can avoid including a polyfill.
@itayod Okay, I’ll see what I can do. Thank you.