App reviews, troubleshooting, and recommendations
I want to get current date in Cart and Checkout Validation Function API. I'm using this:
new Date()
But it returns 01/01/1970. I tried to use another ways but cannot get current date.
Can somebody explain this?
And how to i get Current Date in Cart and Checkout Validation Function API?
Thank in advance.
Solved! Go to the solution
This is an accepted solution.
JS date won't work since functions are deterministic.
The Shopify team has some additions in the works to add the date to the input query.
This is an accepted solution.
JS date won't work since functions are deterministic.
The Shopify team has some additions in the works to add the date to the input query.
Thanks for your reply.
Do we know if there is a rough ETA for this please, and if the store time be available as well?
Good news.
localTime field is on unstable version.
You can check the documentation.
Thank you
Unfortunately, it is still limited to a date without time.
"2019-07-16"
Shopify could add time as well, instead of multiple date time comparison functions in GraphQL
I also need the current dateTime in my function not a comparison. I opened a feature request on GitHub, please upvote it @adkhamllama.
We want to take a moment to celebrate the incredible ways you all engage with the Shopi...
By JasonH Oct 15, 2024Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024