0 purchases
timed
timed #
Calculates the time interval between two dates in seconds, minutes, days, weeks, months, or years.
Installation #
dev_dependencies:
timed: ^0.0.1
copied to clipboard
Usage #
import 'package:timed/timed.dart';
var result = Timed.get(to: DateTime(2022, 05, 01));
copied to clipboard
or
import 'package:timed/timed.dart';
var to = DateTime(2022, 05, 01);
var from = DateTime(2022, 12, 01);
var result = Timed.get(to: to, from: from);
copied to clipboard
or
import 'package:timed/timed.dart';
var result = DateTime.now().toTimed;
copied to clipboard
This returns a Map<String,dynamic>, the keys to this map are seconds, second, minutes, minute,hours, hour, days, day, weeks, week, months, month, years, year and date.
Note: {weeks: 2} In this map the key to use in my translation resource and the value, ready is the value 😅😎
date is the key returned when it is not possible to estimate the time
That was one of the tactics used in the project pub.dev
Support #
You liked this package? then give it a star. If you want to help then:
Start this repository
Send a Pull Request with new features
Share this package
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.