coodoo-io / coo_extensions

coo(l) extensions! A set of commonly used Dart/Flutter extension to ease development.
MIT License
0 stars 0 forks source link

DateTime isSameYear(date), isSameMonth(date), isSameDay(date) #9

Open stevsimo opened 1 week ago

stevsimo commented 1 week ago

It would be nice to add following methods:

bool isSameYear(DateTime date) {
    return this.year == date.year;
  }

bool isSameMonth(DateTime date) {
    return this.year == date.year && this.month == date.month;
  }

bool isSameMonth(DateTime date) {
    return this.year == date.year && this.month == date.month && this.day == date.day;
  }
JPM84 commented 1 week ago

Sounds cool. You can open a pull-request if you like. Otherwise will consider this in the next update round.