-
Notifications
You must be signed in to change notification settings - Fork 863
Add a pure date field type #273
Comments
I think a better solution would be a field argument 'format'. A date is a date, stored as a date. Formatting requirements should not creep into the storage model.
|
Great point, see also #91. |
I know, I created https://github.com/graphcool/feature-requests/issues/240 before, so just taking the opportunity to make that point again 👍 |
Dates and datetimes are very different. A person wants to store their birthdate with the year, month, and day that they like, usually in the time zone in which they were born. DateTimes are instants. IT doesn't feel right to use a datetime for a birthdate field. Yeah it works if you "assume UTC and ignore H, M, S, and all the small fields...." Just feels dirty. A pure date time would be nice. In the meantime, storing year, month, and day works too. Dates and times are hard. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions. |
You can use
DateTime
to store dates like this2017-06-25
, which will be converted to2017-06-25T00:00.000Z
. As an addition to this, storing pure date fields would be nice so you don't have to think about timezones when displaying it:2017-06-25
won't be converted.The text was updated successfully, but these errors were encountered: