Hi,
I need the day field in format YYYY-MM-DD. But I always get something with time returned. Also I played a bit around with setting a time like in middle of the the so the date is not changed, but often it seems to return the wrong date… Also tried parseDate but had no success…
if I leave the date field empty I can get all the items… see following screenshot. so the api is working. but I am trying to get as an example the item Bundle 502 in the screenshot. There you can see day is 2024-08-20. But I can get nothing.
Time zone issues are possible here (the server is UTC+0), so it's best to provide a date. This can either be done using a query parameter or the X-Date header. In both cases, use the date format "YYYY-MM-DD".
GET /api/todayItems?date=2021-11-15
X-API-Token: XYZ
=>
[...]
OR
GET /api/todayItems
X-API-Token: XYZ
X-Date: 2021-11-15
=>
[...]
Your date needs to be parsed as a date to use the formatDate() function. The way you have it is a string value. Use the parseDate() function and specify the format of the date that is a string value. Then you use the formatDate() to change it to your desired format.
Try placing it into another parseDate() function like this:
{{parseDate(formatDate(parseDate(“2024-08-20 12:00”; “YYYY-MM-DD HH:mm”); “YYYY-MM-DD”))}}
When you format a date it changes into a text value. For that particular field it is looking for a date value. But the input value is correctly displaying a date so should work…