Consider Weekends When Using dateAdd Helper
Hey all,
I am currently using the following statement to map the order date from Shopify + 2 days into a NetSuite "Ship By" field. Currently, weekdays and weekends are handled the same, but I would like to adjust it to basically add 2 business days instead.
I.e.: if an order is placed in Shopify on Friday, the "Ship By" date in NetSuite should end up being Tuesday, where currently it would map in as Sunday.
{{dateAdd $.created_at "172800000" ""}}
I can't figure out how I can differentiate a weekend from a weekday. If I can make that differentiation, I suppose I can use #compare. But maybe there's a better approach.
Thanks in advance for any support.
0
Comments
Hey Justin,
That definitely seems to be an interesting approach to setting the Ship By date. Our functions work with explicit date figures and we're not really looking for the Day of the week. Here are your options:
Option A:
Option B:
For businesses where the Ship By date is critical e.g. gifts, this value often comes from the website itself and in all other use cases, the reference goes off the 'Created At' date for any downstream activities like packing or shipping.
We'll be sure to put in a note with our engineering team to review the demand and feasibility of recognizing the day of the week within our functions. Appreciate you contributing to the community!
Best,
Mannan
Please sign in to leave a comment.