CalendarTime class

Main class

Constructors

CalendarTime([dynamic _date])
Create a calendar time object by passing in a date Not passing in a date will create a CalendarTime at the present date
CalendarTime.fromString(String input, [String? pattern, String? locale])
Generate a CalendarTime object from a string with a custom format
factory

Properties

dateLocal DateTime
Returns this DateTime value in the local time zone.
no setter
dayFormat ↔ DateFormat
Specify the format used for the date portion of any formatting Use the format DateFormat.<skeleton>
getter/setter pair
endOfDay DateTime
Get the time at the end of the day given to the CalendarTime obejct
no setter
endOfNextWeek DateTime
Get the time at the end of next week note this is based on the current time, not the time passed into the CalendarTime
no setter
endOfToday DateTime
Get the time at the end of today, note this is based on the current time, not the time passed into the CalendarTime If you want the end of the day of the CalendarTime object, use endOfDay
no setter
endOfTomorrow DateTime
Get the time at the end of tomorrow note this is based on the current time, not the time passed into the CalendarTime
no setter
formatTime String
Will return the date in format specified in CalendarTime.timeformat
no setter
fullDayFormat ↔ DateFormat
Specify the format when outputting a full date Use the format DateFormat.<skeleton>
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isLastWeek bool
Boolean check to see if the current date is last week
no setter
isNextWeek bool
Boolean check to see if the current date is next week
no setter
isToday bool
Boolean check to see if the current date is today
no setter
isTomorrow bool
Boolean to check if the current date is tomororw
no setter
isYesterday bool
Boolean check to see if the current date is yesterday
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
startOfDay DateTime
Get the DateTime at the start of the calendar time day note this is based on the time time passeed into CalendarTime If you want the start of today object use startOfToday
no setter
startOfLastWeek DateTime
Get the time at the start of last week note this is based on the current time, not the time passed into the CalendarTime
no setter
startOfToday DateTime
Get the DateTime at the start of today. note this is based on the current time, not the time passed into the CalendarTime
no setter
startOfYesterday DateTime
Get the time at the start of yesterday note this is based on the current time, not the time passed into the CalendarTime
no setter
timeFormat ↔ DateFormat
Specify the format for times when outputting Specify it as DateFormat.<skeleton>
getter/setter pair
toDate DateTime
no setter
toHuman String
Convert the date into a human readable representation of a time For example if a datetime is today at 4:30 it will return "Today at 4:30pm"
no setter
toHumanArray List<String>
The same as calling toHuman except it breaks down the result into array 0 is date, 1 is time
no setter
toHumanMultiLine String
The same as calling toHuman except it breaks down the result into multiple lines for a vertical display
no setter

Methods

add(Duration duration) DateTime
Adds a duration to the current DateTime
endOfWeek({int weekDayStart = DateTime.monday}) DateTime
Get the date at the end of the week based on the weekDayStart this is based on the time passed into CalendarTime.
format(String formatString) String
Format the date in a string given a format string.
isSameDayAs(DateTime comparisonDate) bool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
startOfWeek({int weekDayStart = DateTime.monday}) DateTime
Get the date at the start of the week based on the weekDayStart this is based on the time passed into CalendarTime.
subtract(Duration duration) DateTime
Subtract a duration from the current DateTime
toString() String
A string representation of this object.
inherited

Operators

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