v1.1.1
simple_moment
सापेक्ष समय के लिए Moment.js विशेषताओं का एक सरल कार्यान्वयन।
51लाइक 48330-दिन डाउनलोड120Pub अंक
AndroidiOSWebmacOSWindowsLinux
डार्ट में आपेक्षिक समय की विशेषताओं का एक सरल कार्यान्वयन, जैसे कि मोमेंट.जीएस
यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।
A simple implementation of the Moment.js features for relative time in Dart.
A simple usage example:
import 'package:simple_moment/simple_moment.dart';
main() {
var secondsToAdd = Duration(seconds: 10);
var dateForComparison = DateTime.now().add(secondsToAdd);
var moment = Moment.now();
// should print "in a few seconds"
print(moment.from(dateForComparison));
Moment rawDate = Moment.parse("2020-07-03");
// should print "2020-08-03 00:00:00.000
print(rawDate.add(months: 1));
// should print "2019-07-03 00:00:00.000
print(rawDate.subtract(years: 1));
//should print "03-07-2020 00:00"
print(rawDate.format("dd-MM-yyyy HH:mm"));
}
Moment:Moment.setLocaleGlobally(new LocaleDe());
Moment:var moment = new Moment.now().locale(new LocaleDe());
Just create a class that implements ILocaleData and assign that to your Moment instance or set it globally.
class ShortLocaleEn extends LocaleEn {
String get seconds => '%is';
String get aMinute => '%im';
String get minutes => '%im';
String get anHour => '%ih';
String get hours => '%ih';
String get aDay => '%id';
String get days => '%id';
}
intl to format dates// create new Moment instance with german locale
var moment = Moment.now().locale(LocaleDe(), useInFormat: true);
// initialize intl
await initializeDateFormatting(moment.usedLocale.localeString);
// format and print the current month in german
var formattedString = moment.format("LLLL");
print(formattedString);
Please file feature requests and bugs at the issue tracker.
उपयोग के अनुसार छाँटें, गतिविधि की तुलना करें और अपनाने से पहले मूल प्रोजेक्ट की आवश्यकताएँ जाँचें।
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗