You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
there is a TypeScript error, since the date is formatted incorrectly. This is of course a simplified version, the date is set by the user.
Where I am running into an issue is that there is no good way to format a date to work with this format.
Even if I create a helper function that returns the individual values formatted in the string Contentful expects, the individual numbers become an issue if they're less than 10, because I can't prepend a 0, since it's a number. So for example, if the day or month are less than 10, I end up with a string that looks like this 1-1-2024T11:59:59 which does not work when sending the request to Contentful, the date needs to be formatted like 01-01-2024T11:59:59.
Thank you in advanced for any insight or help.
The text was updated successfully, but these errors were encountered:
I don't think this is necessarily a bug, but I have hit a dead-end trying to work around it, and searching has come up empty.
From
node_modules/contentful/dist/types/types/entry.d.ts
:so when trying to make a content API call with parameters like...
there is a TypeScript error, since the date is formatted incorrectly. This is of course a simplified version, the date is set by the user.
Where I am running into an issue is that there is no good way to format a date to work with this format.
Even if I create a helper function that returns the individual values formatted in the string Contentful expects, the individual numbers become an issue if they're less than 10, because I can't prepend a 0, since it's a number. So for example, if the day or month are less than 10, I end up with a string that looks like this
1-1-2024T11:59:59
which does not work when sending the request to Contentful, the date needs to be formatted like01-01-2024T11:59:59
.Thank you in advanced for any insight or help.
The text was updated successfully, but these errors were encountered: