MomentLocalization class abstract

Extend this class to create new localization

Implementers

Constructors

MomentLocalization()

Properties

calendarData CalenderLocalizationData?
no setter
countryCode String?
Country code as defined in ISO 3166-1 alpha-2
no setter
defaultFormatters → FormatSetOptional
final
endonym String
Language name in the language itself
no setter
formatters → FormatSetOptional
no setter
hashCode int
The hash code for this object.
no setterinherited
languageCode String
Language code defined in ISO 639-1
no setter
languageNameInEnglish String
Language name in English
no setter
locale String
Locale ID
no setter
nonFinalFormatters Map<FormatterToken, FormatterTokenFn>
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tokens List<FormatterToken>
final
weekdayName Map<int, String>
Weekdays range from 1-7
no setter
weekStart int
Start of week. For example, Monday for most countries, Sunday for weird ones
no setter

Methods

calendar(Moment moment, {DateTime? reference, String? customFormat, bool omitHours = false, bool omitHoursIfDistant = true}) String
Calendar string
calendarTime(Moment moment) String
Some languages require article before the hours. For example, la 1:20, las 13:20 (Spanish)
duration(Duration duration, {bool round = true, bool omitZeros = true, bool includeWeeks = false, Abbreviation form = Abbreviation.none, String? delimiter, DurationFormat format = DurationFormat.auto, bool dropPrefixOrSuffix = false}) String
This will return precise durations. For imprecise durations, use relative()
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
overrideFormatters() → FormatSetOptional
reformat(DateTime dateTime, String payload) String
relative(Duration duration, {bool dropPrefixOrSuffix = false, Abbreviation form = Abbreviation.none}) String
Toggle dropPrefixOrSuffix to get spanned duration without any prefix or suffix.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

relativeThreshold(Duration duration) DurationInterval
Uses MomentLocalization._relativeThresholds map. Refer to this table for details: https://momentjs.com/docs/#/displaying/fromnow/
startOfWeek(Moment refernce, [int startingWeekday = DateTime.monday]) Moment