Creates a new CustomDateAdapter
(injected) the IntlAdapterService; make sure to add this to your global providers in the app or core module.
(injected) the locale to use for formatting.
Whether to clamp the date between 1 and 9999 to avoid IE and Edge errors.
(injected) the IntlAdapterService; make sure to add this to your global providers in the app or core module.
The locale to use for all dates.
A stream that emits when the locale changes.
Pads a number to make it two digits.
The number to pad.
The padded number.
Creates a date but allows the month and date to overflow.
When converting Date object to string, javascript built-in functions may return wrong results because it applies its internal DST rules. The DST rules around the world change very frequently, and the current valid rule is not always valid in previous years though. We work around this problem building a new Date object which has its internal UTC representation with the local date and time.
Date from which we want to get the string representation according to dtf
A Date object with its UTC representation based on the passed in date info
Strip out unicode LTR and RTL characters. Edge and IE insert these into formatted dates while other browsers do not. We remove them to make output consistent and because they interfere with date parsing.
The string to strip direction characters from.
The stripped string.
Clamp the given date between min and max dates.
The date to clamp.
The minimum value to allow. If null or omitted no min is enforced.
The maximum value to allow. If null or omitted no max is enforced.
min
if date
is less than min
, max
if date is greater than max
,
otherwise date
.
Compares two dates.
The first date to compare.
The second date to compare.
0 if the dates are equal, a number less than 0 if the first date is earlier, a number greater than 0 if the first date is later.
Returns the given value if given a valid Date or null. Deserializes valid ISO 8601 strings (https://www.ietf.org/rfc/rfc3339.txt) into valid Dates and empty string into null. Returns an invalid date for all other values.
Checks if two dates are equal.
The first date to check.
The second date to check.
Whether the two dates are equal. Null dates are considered equal to other null dates.
Sets the locale used for all dates.
The new locale.
Generated using TypeDoc
Adaption of https://github.com/angular/components/blob/master/src/material/core/datetime/native-date-adapter.ts