Get the day of the month.
FDate.now().day// => 1-31
Get the name of the day.
FDate.now().dayName// => Monday
Get the short name of the day.
FDate.now().dayNameShort// => Mon
Get the month.
Months are one-indexed, so January is month 1.
FDate.now().month()// => 1-12
Get the name of the month.
FDate.now().monthName// => January
Get the short name of the month.
FDate.now().monthNameShort// => Jan
Get the week according to the Swedish locale.
Get the year.
FDate.now().year()// => 2022
Returns true if this date is after given date.
If the dates are the same this function returns false.
Returns true if this date is before given date.
If the dates are the same this function returns false.
Returns a string representation of the date.
FDate().toString() // "2022-05-04"
FDate().toString(DateFormat.FULL) // "onsdag 4 maj 2022"
FDate().toString(DateFormat.LONG) // "4 maj 2022"
FDate().toString(DateFormat.ISO8601) // "2022-04-20"
Format to use.
Static
compareCompares two FDate objects. Returns and integer indicating whenever
a
comes before or after or is equal to b
.
-1
if a
beomes before b
.0
if a
and b
are the same date.1
if a
beomes after b
.If either or both date is invalid the result is undefined behaviour and
should not be relied on. Use FDate.isValid to ensure validity
first, e.g. myArray.filter(it => it.isValid())
before sorting.
-1
, 0
or 1
Static
fromStatic
fromStatic
fromStatic
now
Represents a date (with year, month and day).