Moment class
Constructors
- Moment.fromDate(DateTime date)
- Create a moment instance from Date
- Moment.fromDateTime(DateTime _date)
- Moment.fromMillisecondsSinceEpoch(int millisecondsSinceEpoch, {bool isUtc = false})
- Create a date from milliseconds
- Moment.now()
Properties
- date → DateTime
-
no setter
- day → int
-
The day of the month
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- month → int
-
The month
no setter
- quarter → int
-
The quarter
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- usedLocale → ILocaleData
-
no setter
- weekday → int
-
The day of the week
no setter
- year → int
-
no setter
Methods
-
add(
{int years = 0, int quarters = 0, int months = 0, int weeks = 0, int days = 0, int hours = 0, int minutes = 0, int seconds = 0, int milliseconds = 0, int microseconds = 0}) → Moment - Adds time to the current date
-
compareTo(
DateTime date) → int - Compares the given date to the current one
-
format(
String pattern, {String? localeOverride}) → String - Formats the date to the given format
-
from(
DateTime date, [bool withoutPrefixOrSuffix = false]) → String -
fromNow(
[bool withoutPrefixOrSuffix = false]) → String -
locale(
ILocaleData locale, {dynamic useInFormat = false}) → Moment - Sets the locale for this instance
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
subtract(
{int years = 0, int quarters = 0, int months = 0, int weeks = 0, int days = 0, int hours = 0, int minutes = 0, int seconds = 0, int milliseconds = 0, int microseconds = 0}) → Moment - Substracts time to the current date
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- monthPerQuarter ↔ int
-
getter/setter pair
Static Methods
-
parse(
String date) → Moment - Converts a Date String to an actual DateTime object
-
setLocaleGlobally(
ILocaleData locale, {dynamic useInFormat = false}) → dynamic - Sets the global locale