DateTimeCalculator class final

Constructors

DateTimeCalculator()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

addMonths(DateTime date, int count) DateTime
Adds the specified number of months to the given DateTime.
getDaysCountInMonth(int year, int month) int
Returns the number of days in the specified month and year.
getWeekNumber(DateTime date) int
Returns the week number of the given DateTime within the year.
isBetween(DateTime date, DateTime start, DateTime end) bool
Checks if the given DateTime is between the start and end DateTimes (exclusive).
isLeapYear(int year) bool
Checks if the given year is a leap year.
roundToDayEnd(DateTime date) DateTime
Rounds the given DateTime to the end of the day (23:59:59).
roundToDayStart(DateTime date) DateTime
Rounds the given DateTime to the start of the day (00:00:00).
roundToFirstDayOfMonth(DateTime date) DateTime
Rounds the given DateTime to the first day of the month.
roundToFirstDayOfWeek(DateTime date) DateTime
Rounds the given DateTime to the first day of the week (Monday).
roundToFirstDayOfYear(DateTime date) DateTime
Rounds the given DateTime to the first day of the year.
roundToLastDayOfMonth(DateTime date) DateTime
Rounds the given DateTime to the last day of the month.
roundToLastDayOfWeek(DateTime date) DateTime
Rounds the given DateTime to the last day of the week (Sunday).
roundToLastDayOfYear(DateTime date) DateTime
Rounds the given DateTime to the last day of the year.
subtractMonths(DateTime date, int count) DateTime
Subtracts the specified number of months from the given DateTime.