Inconsistent date formation in Products api

I have been experimenting with the Products api and I have noticed an inconsistency with the format of the dates that are returned in the response:

For the dateCreated field the date is returned as a timestamp in ISO-8601 format.
For the lastUpdated field the data is returned as a plain date in “MMM dd, YYYYY” form.

Is this expected behavior?

Blockquote
{“data”:[{“active”:true,“category”:“IT Equipment”,“color”:null,“dateCreated”:“2023-01-25T17:59:24Z”,“description”:null,“handlingIcons”:[],“id”:“8ab0841585e9ebee0185ea15a2ba00a2”,“lastUpdated”:“Jan 25, 2023”,“lotAndExpiryControl”:false,“name”:“Adapter, USB-C male to HDMI + VGA female”,“pricePerUnit”:25.99,“productCode”:“AX738”,“unitOfMeasure”:“Each”,“updatedBy”:“Miss Administrator”},{“active”:true,“category”:“IT Equipment”,“color”:null,“dateCreated”:“2023-01-25T17:59:24Z”,“description”:null,“handlingIcons”:[],“id”:“8ab0841585e9ebee0185ea15a2c700a3”,“lastUpdated”:“Jan 25, 2023”,“lotAndExpiryControl”:false,“name”:“Adapter, USB-C Male to HDMI Female”,“pricePerUnit”:59.99,“productCode”:“GK233”,“unitOfMeasure”:“Each”,“updatedBy”:“Miss Administrator”},{“active”:true,“category”:“Office Supplies”,“color”:null,“dateCreated”:“2023-01-25T17:59:24Z”,“description”:null,“handlingIcons”:[{“color”:“#ffa500”,“icon”:“fa-exclamation-triangle”,“label”:“Hazardous material”}],“id”:“8ab0841585e9ebee0185ea15a3ec00b6”,“lastUpdated”:“Jan 25, 2023”,“lotAndExpiryControl”:false,“name”:“Batteries, Non Rechargeable, AA”,“pricePerUnit”:1.5,“productCode”:“XJ173”,“unitOfMeasure”:“Each”,“updatedBy”:“Miss Administrator”},{“active”:true,“category”:“Office Supplies”,“color”:null,“dateCreated”:“2023-01-25T17:59:24Z”,“description”:null,“handlingIcons”:[{“color”:“#ffa500”,“icon”:“fa-exclamation-triangle”,“label”:“Hazardous material”}],“id”:“8ab0841585e9ebee0185ea15a3f900b7”,“lastUpdated”:“Jan 25, 2023”,“lotAndExpiryControl”:false,“name”:“Batteries, Non Rechargeable, AAA”,“pricePerUnit”:1.5,“productCode”:“RU651”,“unitOfMeasure”:“Each”,“updatedBy”:“Miss Administrator”},{“active”:true,“category”:“IT Equipment”,“color”:null,“dateCreated”:“2023-01-25T17:59:24Z”,“description”:null,“handlingIcons”:[{“color”:“#ffa500”,“icon”:“fa-exclamation-triangle”,“label”:“Hazardous material”}],“id”:“8ab0841585e9ebee0185ea15a2d400a4”,“lastUpdated”:“Jan 25, 2023”,“lotAndExpiryControl”:false,“name”:“Battery, for canon LP-E6N”,“pricePerUnit”:61,“productCode”:“QA069”,“unitOfMeasure”:“Each”,“updatedBy”:“Miss Administrator”}],“totalCount”:58}

Oh, that’s weird. Both dates should be in ISO-8601 format. We’ll investigate.

Thanks again for reporting this anomaly.

So the date format was changed in the following commit, so it looks like it was done on purpose.

We have been redesigning a lot of UIs and from my understanding, this was a change made during the List Products redesign i.e. the Last updated column is displayed with the “MMM dd, yyyy” format.

I’ll add a ticket to revert this change for v0.8.22 and request that all date formatting be handled on the frontend.

Justin