flutter_date_difference

Last updated:

0 purchases

flutter_date_difference Image
flutter_date_difference Images
Add to Cart

Description:

flutter date difference

flutter_date_difference #
Published Package on pub.dev
Usage
import 'package:flutter_date_difference/flutter_date_difference.dart';

var _dateDifference = FlutterDateDifference();
print(_dateDifference.calculate(DateTime(2023, 1, 1), DateTime(2023, 1, 2))); // 1 Day
print(_dateDifference.calculate(DateTime(2023, 1, 1), DateTime(2023, 1, 3))); // 2 Days
print(_dateDifference.calculate(DateTime(2023, 1, 1), DateTime(2023, 2, 1))); // 1 Month
print(_dateDifference.calculate(DateTime(2023, 1, 1), DateTime(2023, 6, 1))); // 5 Months
print(_dateDifference.calculate(DateTime(2023, 1, 1), DateTime(2023, 6, 2))); // 5 Months 1 Day
print(_dateDifference.calculate(DateTime(2023, 1, 1), DateTime(2023, 6, 13))); // 5 Months 12 Days
print(_dateDifference.calculate(DateTime(2023, 1, 1), DateTime(2024, 1, 1))); // 1 Year
print(_dateDifference.calculate(DateTime(2023, 1, 1), DateTime(2024, 1, 2))); // 1 Year 1 Day
print(_dateDifference.calculate(DateTime(2023, 1, 1), DateTime(2024, 1, 3))); // 1 Year 2 Days
print(_dateDifference.calculate(DateTime(2023, 1, 1), DateTime(2025, 4, 1))); // 2 Years 3 Months
print(_dateDifference.calculate(DateTime(2023, 1, 1), DateTime(2026, 5, 28))); // 3 Years 4 Months 27 Days
copied to clipboard
Change Local
_dateDifference.setLanguage(language: "de");
copied to clipboard
Change Words
_dateDifference.setTexts(year: "Year", yearPlural: "Years", month: "Month", monthPlural: "Months", day: "Day", dayPlural: "Days");
copied to clipboard
Ready Languages
en // Default
tr
de
fr
it
ar
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.