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 when Intl.RelativeTimeFormat is not available #428

Merged
merged 1 commit into from
Apr 15, 2021
Merged

Fix when Intl.RelativeTimeFormat is not available #428

merged 1 commit into from
Apr 15, 2021

Conversation

MrOrz
Copy link
Member

@MrOrz MrOrz commented Apr 15, 2021

Fixes #426.

  • When Intl.RelativeTimeFormat is available, use it.
    • It provides better strings like "yesterday", "前天"
  • Otherwise, fallback to date-fns v2

Chrome 70

image

Safari 13

image

Browsers with Intl.RelativeTimeFormat

image
image

@MrOrz MrOrz self-assigned this Apr 15, 2021
@MrOrz MrOrz merged commit 9bece90 into dev Apr 15, 2021
@MrOrz MrOrz deleted the fix-rtf branch April 15, 2021 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chrome < 71, iOS safari 13 does not have Intl.RelativeTimeFormat
2 participants