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

Feature request: Port Moment.js and Moment Timezone to Dart #31523

Closed
matthewlloyd opened this issue Apr 23, 2019 · 5 comments
Closed

Feature request: Port Moment.js and Moment Timezone to Dart #31523

matthewlloyd opened this issue Apr 23, 2019 · 5 comments
Labels
P3 Issues that are less important to the Flutter project package flutter/packages repository. See also p: labels. would be a good package Separate Flutter package should be made for this

Comments

@matthewlloyd
Copy link
Contributor

The DateTime classes provided by the Dart runtime library are okay but lacking many of the features of e.g. Moment and Moment Timezone. It would be great to have a powerful, world-class library for this, either provided by Flutter itself (to integrate properly with iOS/Android native APIs) or as a package.

https://momentjs.com/

@jonahwilliams
Copy link
Member

Does this package accomplish those goals? https://pub.dartlang.org/packages/timezone

@jonahwilliams jonahwilliams added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 23, 2019
@dnfield dnfield added the would be a good package Separate Flutter package should be made for this label Apr 24, 2019
@dnfield
Copy link
Contributor

dnfield commented Apr 24, 2019

It's not full featured and not moment.js, but I did write a Gregorian calendar package at some point (https://pub.dartlang.org/packages/date_calendar). There's also intl (https://pub.dartlang.org/packages/intl) which can help with formatting and parsing of DateTimes in various locales.

@matthewlloyd
Copy link
Contributor Author

I took a deep dive into Dart's datetime and timezone libraries, and compared them with Moment and Moment.timezone. This table summarizes what I found. TLDR; Dart has perhaps 2/3 of the features implemented, but they are scattered across various packages, some official, some 3rd party. Most of what I need has already been written (thanks!), but I still think it would be really nice to have one official and comprehensive package. ;)

Feature Moment.js / Moment.timezone Dart
locale-aware datetime formatting yes, 100+ locales yes, 100+ locales
relative time formatting ("5 minutes ago") yes, 100+ locales use timeago package, supports 21 locales
calendar time formatting ("tomorrow at 2pm") yes, 100+ locales no
datetime parsing yes, RFC 2822 yes, RFC 3339
manipulation: add, subtract, durations, etc. yes yes
humanized duration formatting ("5 minutes 10 seconds") yes, 100+ locales no
timezone database yes use timezone package
timezone names, abbreviations, formatting etc. yes use timezone package
get user's timezone yes use flutter_native_timezone package; full compatibility with timezone package not guaranteed

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 1, 2019
@VladyslavBondarenko VladyslavBondarenko added the package flutter/packages repository. See also p: labels. label Jan 13, 2020
@flutter-triage-bot flutter-triage-bot bot added P3 Issues that are less important to the Flutter project and removed P6 labels Jun 28, 2023
@stuartmorgan
Copy link
Contributor

Based on the updated guidance in https://github.com/flutter/flutter/wiki/Issue-hygiene#closing-issues, I'm going to close this issue, better reflecting the expectation that this is not something that the Flutter team plans to implement.

@stuartmorgan stuartmorgan closed this as not planned Won't fix, can't repro, duplicate, stale Jul 7, 2023
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 Issues that are less important to the Flutter project package flutter/packages repository. See also p: labels. would be a good package Separate Flutter package should be made for this
Projects
None yet
Development

No branches or pull requests

5 participants