simple_date_formatter 1.0.1 copy "simple_date_formatter: ^1.0.1" to clipboard
simple_date_formatter: ^1.0.1 copied to clipboard

A simple way to format dates

Simple Date Formatter #

A very simple package to format DateTime objects in simple terms like Today, Next Week Wednesday etc.

Usage #

Import simple_date_formatter.dart

import "package:simple_date_formatter/simple_date_formatter.dart";

Use the fromNow getter on any DateTime object.

DateTime someDate = DateTime.now().add(Duration(days: 20));
print(someDate.fromNow); // Next Week Friday.
// This getter formats the date up to six week before and after now, beyond which it will return normal date formatting.

Additional Features #

This package also exposes two extra getters and one method. monthName getter weekdayName getter and addTime method.

DateTime someDate = DateTime.now().add(Duration(days: 20));
print(someDate.monthName); // December
print(someDate.weekdayName): // Friday
someDate.addTime(TimeOfDay(hour: 10: minute: 30)); // adds time to `DateTime` object and returns it.

Don't forget to leave a like 👍

1
likes
140
points
52
downloads

Publisher

unverified uploader

Weekly Downloads

A simple way to format dates

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on simple_date_formatter