DateFromString constructor
DateFromString({
- @required dynamic dateString,
- dynamic format,
- dynamic timezone,
- dynamic onError,
- dynamic onNull,
Creates $dateFromString
operator expression
Converts a date/time string to a date object.
dateString
- The date/time string to convert to a date object.format
- Optional. The date format specification of thedateString
. The format can be any expression that evaluates to a string literal, containing 0 or more format specifiers.- {timezone} - Optional. The time zone to use to format the date.
onError
- Optional. If $dateFromString encounters an error while parsing the given dateString, it outputs the result value of the providedonError
expression. This result value can be of any type. If you do not specifyonError
,$dateFromString
throws an error if it cannot parsedateString
.onNull
- Optional. If thedateString
provided to$dateFromString
isnull
or missing, it outputs the result value of the providedonNull
expression. This result value can be of any type. If you do not specifyonNull
and dateString is null or missing, then $dateFromString outputs null.
Implementation
DateFromString({@required dateString, format, timezone, onError, onNull})
: super(
'dateFromString',
AEObject({
'dateString': dateString,
'format': format,
'timezone': timezone,
'onError': onError,
'onNull': onNull
}));