ms_datetime_extensions 1.1.0 copy "ms_datetime_extensions: ^1.1.0" to clipboard
ms_datetime_extensions: ^1.1.0 copied to clipboard

A simple and usefull lib to incremease DateTime with usefull functions

Overview #

Pub GitHub stars Buy Me A Coffee donate button

A simple lib to augment the DateTime with useful functions

What's ms_datetime_extensions do #

Add usefull functions to DateTime:

  • copyWith return a new DateTime with new values
  • fromInternet fetch a DateTime from internet
  • isAtSame[second,minute,hour,day,month,year] return true when compare datetime to other
  • isAtToday return true if DateTime is today
  • nextDayOfTheWeek return a new DateTime to a next weekday
  • previousDayOfTheWeek return a new DateTime to a previous day of the weekday

Usage #

Just import lib and use extensions, call the functions to starts work:

import 'package:ms_datetime_extensions/ms_datetime_extensions.dart';

  var xmas = DateTime(2020, 12, 25, 15, 00); // Friday 25 december of 2020
  var nextFriday =
      xmas.nextWeekday(DateTime.friday); // Friday 01 january of 2021
  print(nextFriday);

  var mDateTimeFromInternet = await dateTimeFromInternet();

  var endYear = xmas.copyWith(day: 0); // Thursday 31 dezember of 2020

This lib use thirtpart API visite worldtimeapi to know more

6
likes
140
points
68
downloads

Publisher

verified publishermarcussoftware.info

Weekly Downloads

A simple and usefull lib to incremease DateTime with usefull functions

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

http

More

Packages that depend on ms_datetime_extensions