DateExt extension
Extension methods for DateTime objects.
- on
Methods
-
st_timeAgo(
) → TimeAgo - Computes the time elapsed since the date.
-
st_toEn(
{bool withTime = false, bool withDay = true}) → String - Converts the date to an English-formatted string.
-
st_toFormat(
String format) → String -
Available on DateTime, provided by the DateExt extension
Formats the date according to the specifiedformat
. -
st_toFr(
{bool withTime = false, bool withDay = true}) → String - Converts the date to a French-formatted string.
-
st_toJson(
) → Map< String, int> - Converts the date to a JSON representation.
-
st_toTimestamp(
) → String - Converts the date to a timestamp string.
Operators
-
operator +(
Duration other) → DateTime -
Available on DateTime, provided by the DateExt extension
Adds the givenother
duration to the date. -
operator -(
Duration other) → DateTime -
Available on DateTime, provided by the DateExt extension
Subtracts the givenother
duration from the date.