Umbraco-CMS: Invalid date returned from `contentResource.getById`
Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)
10.2.1
Bug summary
When I use contentResource.getById() I get document incl. tabs and properties.
However for some

but the endpoint GetById does return a valid date.

Specifics
No response
Steps to reproduce
Request different documents usings contentResource.getById. Depending on the date, some of these are returned as invalid date from angular resource.
In this case date is 11/20/2022 12:00:00 AM which was picked from a date picker and property editor afterwards changed to label, which is shown on the content node. I should also be mentioned that I afterwards changed datatype of the property from date picker to label (datetime), so the nodes which has been saved afterwards may store the value in a different format.

Expected result / actual result
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 22 (22 by maintainers)
Hi @elit0451
I have made a nice dashboard for you using default starter kit đ Just extract this to
App_Pluginsfolder: MyDashboard.zipOn Home Page node I have added this properties using Date Picker with default configuration.
Next on Home Page node set December 1st 2022 as start date (v11 release date! đđ„ł)
In dashboard it should show this clicking the âShow detailsâ button.
https://user-images.githubusercontent.com/2919859/204396292-cce5a41f-ecb6-4307-bf26-8b0c80e899e9.mp4
Start Date and End Date properties are included, but only End Date is formatted.
If I then change End Date property to using âLabel (datetime)â instead.
then I get this - notice start and end dates hasnât changed, but end date is formatted as
01/20/2012https://user-images.githubusercontent.com/2919859/204397096-17ef0f80-92a1-4c6e-a054-b7b3a860ee62.mp4
The locale is
en-USbut even before formatting date it log the content node, which property value is01/20/2012:even though the date stored in database and returned from
GetByIdAPI method is12/1/2022 12:00:00 AM:Hi @elit0451
It just used the standard datatype instance âDate Pickerâ.
Afterwards I changed the property editor to âLabel (datetime)â as these data will be imported via a Hangfire job, so using the date picker was mainly to set a data and get a value in the property, but I think it shouldnât matter as the value returned from the endpoint looks correct.
Furthermore no content types or properties vary by culture, but we have these languages. We could delete
en-USbut I recall Deploy will re-create this anyway each time a new environment is created on Umbraco Cloud.