DateExtensions extension

on

Properties

daysInMonth List<DateTime>
The list of days in a given month
no setter
firstDayOfMonth DateTime
no setter
firstDayOfWeek DateTime
no setter
isFirstDayOfMonth bool
no setter
isLastDayOfMonth bool
no setter
isLeapYear bool
no setter
isYesterday bool
no setter
lastDayOfMonth DateTime
The last day of a given month
no setter
lastDayOfWeek DateTime
no setter
nextMonth DateTime
no setter
nextWeek DateTime
no setter
previousMonth DateTime
no setter
previousWeek DateTime
no setter

Methods

addOrRemoveDay(int days) → dynamic
to add days to a DateTime add a positive number to remove days pass a negative number
addOrRemoveMinutes(int min) → dynamic
to add min to a DateTime add a positive number to remove min pass a negative number
addOrRemoveMonth(int months) → dynamic
to add month to a DateTime add a positive number to remove years pass a negative number
addOrRemoveSeconds(int sec) → dynamic
to add sec to a DateTime add a positive number to remove sec pass a negative number
addOrRemoveYears(int years) → dynamic
to add years to a DateTime add a positive number to remove years pass a negative number
disAtSameMinuteAs(DateTime other) bool
Returns true if other is at the same minute as this.
isAtSameDayAs(DateTime other) bool
Returns true if other is on the same day as this.
isAtSameHourAs(DateTime other) bool
Returns true if other is at the same hour as this.
isAtSameMicrosecondAs(DateTime other) bool
Returns true if other is at the same microsecond as this.
isAtSameMillisecondAs(DateTime other) bool
Returns true if other is at the same millisecond as this.
isAtSameMinuteAs(DateTime other) bool
Returns true if other is at the same minute as this.
isAtSameMonthAs(DateTime other) bool
Returns true if other is in the same month as this.
isAtSameSecondAs(DateTime other) bool
Returns true if other is at the same second as this.
isAtSameYearAs(DateTime other) bool
Returns true if other is in the same year as this.
isToday() bool
return true if the date is today
max(DateTime that) DateTime
min(DateTime that) DateTime
return the smaller date between
startOfDay() DateTime
Start time of Date times
startOfMonth() DateTime
startOfYear() DateTime
tomorrow() DateTime
next day
yesterday() DateTime
last day

Operators

operator +(Duration duration) DateTime
Adds this DateTime and Duration and returns the sum as a new DateTime object.
operator -(Duration duration) DateTime
Subtracts the Duration from this DateTime returns the difference as a new DateTime object.

Static Methods

daysInRange(DateTime start, DateTime end) Iterable<DateTime>
Returns a DateTime for each day the given range.
isSameDay(DateTime a, DateTime b) bool
Whether or not two times are on the same day.
isSameWeek(DateTime a, DateTime b) bool