We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
date
datetime
Extracted from #20 (comment)
Regarding dates and times they do not appear to qualify the values with a type except optionally with a duration.
DateValue eq 2012-12-03 DateTimeOffsetValue eq 2012-12-03T07:16:23Z DurationValue eq duration'P12DT23H59M59.999999999999S' DurationValue eq 'P12DT23H59M59.999999999999S' TimeOfDayValue eq 07:59:59.999
We could support the following in handleValue
{ type: 'datetimeoffset', value: date }
Date
date.toISOString()
2012-12-03T07:16:23Z
{ type: 'date', value: date }
date.toISOString().split('T')[0]
2012-12-03
We should also support date as either a Date instance or a string (ex. 2018-01-02):
2018-01-02
const dateValue = (typeof date === 'string') ? new Date(date) : date instanceof Date ? date : null const value = dateValue && dateValue.toISOString();
The text was updated successfully, but these errors were encountered:
I think it would be nice also to accept integer, when a type is given.
let dateValue = null; switch (typeof value) { case 'string': case 'number': dateValue = new Date(value).toISOString(); break; case 'object': if (value instanceof Date) dateValue = value.toISOString(); break; }
Sorry, something went wrong.
No branches or pull requests
Extracted from #20 (comment)
Regarding dates and times they do not appear to qualify the values with a type except optionally with a duration.
We could support the following in handleValue
{ type: 'datetimeoffset', value: date }
and aDate
instance (like we do now):date.toISOString()
=>2012-12-03T07:16:23Z
{ type: 'date', value: date }
:date.toISOString().split('T')[0]
=>2012-12-03
We should also support
date
as either aDate
instance or a string (ex.2018-01-02
):The text was updated successfully, but these errors were encountered: