isLeapYear property
bool
isLeapYear
- return
true
the first saturday of the month TODO :: date wont work with last month of the year returns true if date is between tow dates returns true if date year is leaap year
Implementation
// bool get isFirstSaturdayThisMonth =>
// isSaturday &&
// subtract(const Duration()).month ==
// DateTime(year, month, day - DateTime.daysPerWeek).month;
// /// * return [true] the first sunday of the month
// bool get isFirstSundayThisMonth =>
// isSunday &&
// month - 1 == DateTime(year, month, day - DateTime.daysPerWeek).month;
// /// * return [true] the first monday of the month
// bool get isFirstMondayThisMonth =>
// isMonday &&
// month - 1 == DateTime(year, month, day - DateTime.daysPerWeek).month;
// /// * return [true] the first tuesday of the month
// bool get isFirstTuesdayThisMonth =>
// isTuesday &&
// month - 1 == DateTime(year, month, day - DateTime.daysPerWeek).month;
// /// * return [true] the first wednesday of the month
// bool get isFirstWednesdayThisMonth =>
// isWednesday &&
// month - 1 == DateTime(year, month, day - DateTime.daysPerWeek).month;
// /// * return [true] the first thursday of the month
// bool get isFirstThursdayThisMonth =>
// isThursday &&
// month - 1 == DateTime(year, month, day - DateTime.daysPerWeek).month;
// /// * return [true] the first friday of the month
// bool get isFirstFridayThisMonth =>
// isFriday &&
// month - 1 == DateTime(year, month, day - DateTime.daysPerWeek).month;
// bool get isLastSaturdayOfTheYear => day == DateTime.saturday;
// bool get isLastSundayOfTheYear => day == DateTime.sunday;
// bool get isLastMondayOfTheYear => day == DateTime.monday;
// bool get isLastTuesdayOfTheYear => day == DateTime.tuesday;
// bool get isLastWednesdayOfTheYear => day == DateTime.wednesday;
// bool get isLastThursdayOfTheYear => day == DateTime.thursday;
// bool get isLastFridayOfTheYear => day == DateTime.friday;
/// returns true if date is between tow dates
// bool isBetween(DateTime start, DateTime end) =>
// start.isBefore(this) && end.isAfter(this);
/// returns true if date year is leaap year
bool get isLeapYear {
return year % 4 == 0 && year % 100 != 0 || year % 400 == 0;
}