Closed (duplicate)
Project:
JSON:API
Version:
8.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
18 Apr 2017 at 08:53 UTC
Updated:
30 May 2018 at 18:07 UTC
Jump to comment: Most recent
Comments
Comment #2
wim leersThis is blocked on #2926508: Add DateTimeNormalizer+TimestampNormalizer, deprecate TimestampItemNormalizer: @DataType-level normalizers are reusable by JSON:API. Once that is fixed, this should be fixed too. The scope of this issue will then be to provide tests, to ensure BC.
Comment #3
e0ipsoThanks for creating that core issue @Wim Leers. A workaround for the time being is to use JSON API Extras with the date field enhancers.
Comment #4
wim leers#2926508: Add DateTimeNormalizer+TimestampNormalizer, deprecate TimestampItemNormalizer: @DataType-level normalizers are reusable by JSON:API now has a patch that should mostly work. See #2926508-4: Add DateTimeNormalizer+TimestampNormalizer, deprecate TimestampItemNormalizer: @DataType-level normalizers are reusable by JSON:API + #2926508-5: Add DateTimeNormalizer+TimestampNormalizer, deprecate TimestampItemNormalizer: @DataType-level normalizers are reusable by JSON:API.
TimestampItemfields in JSON API should then in theory get the same normalization as in core. Will need tests of course. And we'll first need to see whether we can get this to land in core at all.Comment #5
wim leersOh wait, this is about
DateTimeItem, notTimestampItem?Comment #6
e0ipsoLOL, I had the same mixup in the jsonapi_extras issue queue @Wim Leers.
Comment #7
wim leersHm, it looks/sounds like you created a date field (
DateTimeItem) that is configured to store only a date (\Drupal\datetime\Plugin\Field\FieldType\DateTimeItem::DATETIME_TYPE_DATE).Then #2870609: [PP-1] Core Date field is serialized as String instead of timestamp/long is the relevant issue.
Comment #8
wim leersFFS copy/paste is fragile. The links in #7 obviously didn't make sense.
Comment #9
wim leersWe're fixing this in #2929932: Work around core's ill-designed @FieldType-level TimestampItemNormalizer normalization until #2926508 lands for
timestampfields. But it should also handledatetimeanddaterangefields, see #2929932-5: Work around core's ill-designed @FieldType-level TimestampItemNormalizer normalization until #2926508 lands.Comment #10
wim leers#2929932: Work around core's ill-designed @FieldType-level TimestampItemNormalizer normalization until #2926508 lands is now green and RTBC! Closing this as a duplicate now :)