Open kissmygritts opened 6 years ago
The query (return value from the database) isn't compliant with RFC 3339. I suppose this is due to the postgres formatting: 07:30:00-07
. Instead of 07:30:00-07:00
or in UTC 14:30:00Z
.
All these stupid little nuances slow me down so much, I hate it.
It might be easier to have my GraphQL schema represent times as strings. I honestly don't think they are very important for me.
Or, store start_time
& end_time
as timestamps, and concat the event_date
?
Data passed to the server is fine, it passes GraphQL validation with
graphql-iso-date
with the following query:However this input, when console.logged from the server looks like this (the args parameter in the event.js repo):
Somewhere, todays date (UTC) is being added to the
event_time
and called withnew Date()
to coerce it to a date. This produces the following insert statement for Postgres:Which includes an invalid format for the time field in postgres (
time without timezone
)When I add the following to coerce the time into a time only (eg.
07:31:00-700
) I the insert works. Howevergraphql-iso-date
doesn't like the return time format, which is7:31:00
. Of course, this could be due to me usingtime without timezone
in postgres.Regardless, dates and times are super frustrating.
Oh, and on top of that, The date inserted into the GraphQL server is defaulting as UTC somehow, upon entry into postgres, it is being converted to PST/PDT. So all the dates are, in fact, incorrect.