MomentBenefits extension
- on
Properties
- date → DateTime
-
Returns new
DateTime
with the date at 00:00:00 AM, preserves timezoneno setter - dayOfYear → int
-
Returns ordinal day of the year in the current timezone
no setter
- hour12 → int
-
Returns hour in 12-hour format
no setter
- isAm → bool
-
Returns whether the hour is before noon (ante meridiem) in the current timezone
no setter
- isFuture → bool
-
no setter
- isLeapYear → bool
-
Returns if year is leap year.
no setter
- isPast → bool
-
no setter
- isPm → bool
-
Returns whether the hour is after noon (post meridiem) in the current timezone
no setter
- quarter → int
-
Returns quarter of the year.
no setter
- week → int
-
Returns ISO week number of the year
no setter
- weekYear → int
-
Returns year according to ISO week number of the year
no setter
Methods
-
clone(
) → DateTime -
Returns new
DateTime
, preserves timezone -
differenceInDays(
DateTime other) → int - Difference calculated after omitting hour, minute, ..., microsecond
-
format(
{String payload = MomentLocalization.localizationDefaultDateFormat, bool forceLocal = false, MomentLocalization? localization}) → String -
isFutureAnchored(
[DateTime? anchor]) → bool -
isPastAnchored(
[DateTime? anchor]) → bool -
timeZoneFormatted(
[bool seperateWithColon = true]) → String - Returns timezone:
-
to(
DateTime other) → CustomTimeRange -
Returns CustomTimeRange from this to
other
-
toMoment(
{MomentLocalization? localization}) → Moment
Operators
-
operator +(
Duration other) → dynamic -
Equivalent to
add(other)
-
operator -(
Duration other) → dynamic -
Equivalent to
subtract(other)
-
operator <(
DateTime other) → dynamic -
Equivalent to
isBefore(other)
-
operator <=(
DateTime other) → dynamic -
Equivalent to
isBefore(other) || isAtSameMomentAs(other)
-
operator >(
DateTime other) → dynamic -
Equivalent to
isAfter(other)
-
operator >=(
DateTime other) → dynamic -
Equivalent to
isAfter(other) || isAtSameMomentAs(other)