AbsintheUtils.Scalars.StrictNaiveDateTime (absinthe_utils v0.3.0)
View SourceThe StrictNaiveDateTime scalar type represents a naive date and time without
timezone.
The output is an ISO8601 formatted string.
The input must be a naive datetime, without timezone offset.
Valid examples:
- 2020-01-01T00:00:00
- 2020-01-01 00:00:00
Invalid examples:
- 2020-01-01T00:00:00+00:00
- 2020-01-01T00:00:00+01:00
- 2020-01-01T00:00:00Z
- 2020-01-01 00:00:00Z
Usage:
In your schema, import the type:
import_types(AbsintheUtils.Scalars.StrictNaiveDateTime)Use the type in your schema:
field :my_field, :strict_naive_datetime
Acknowledgements:
Based on the type naive_datetime from Absinthe.Type.Custom.