Reputation: 1
Hi I am currently working with Shopify app.
They are using react and I do not have access to their code base or API.
so my problem here is send correct delivery date to shopify system. Currently, the app is set for customers to choose billing date which we want to change to delivery date.
delivery date is only Tuesday and Friday depending on zipcode and billing dates are 2 days before the delivery date. So what I am trying to do is to make customer choose a date but the actual date sending to shopify system needs to be -2 of what day chose.
I can only use vanila javascript to manipulate the code here but I have no idea where to start this. Please help me with this.
I tried asking API to the app tech team but they dont provide API
Upvotes: 0
Views: 97
Reputation: 31
Try this:
// create new date
const twoDaysAgo = new Date();
// set the date to two days ago
twoDaysAgo.setDate(twoDaysAgo.getDate() - 2);
Upvotes: 0