whenwas

Creator: coderz1093

Last updated:

0 purchases

whenwas Image
whenwas Images
Add to Cart

Description:

whenwas

Whenwas #
Library to calculate how many years, months, days, ... ago a given DateTime is.
Usage #
import 'package:whenwas/whenwas.dart';

main() {
int year = 2000;
var date = DateTime(year);

// x years ago
print(When(date));

// in case you want a custom format:
var time = When(date).toTime();
if (time.unit == TimeUnit.YEAR) {
// x years ago in Spanish
print('Hace ${time.amount} aƱos')
}
}
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.