Manipulate Date Mutation
The Manipulate Date mutation allows you to add or subtract a specified amount of time from a date value. It accepts dates, Unix timestamps, and date strings, and always returns a date. This is useful for shifting publication dates, calculating expiry dates, or adjusting any date-based field in your product feed.
Warning
If the input value cannot be parsed as a date, the mutation will return no value.
Options
- Operation: Whether to
AddorSubtractthe amount of time. - Amount: The number of units to add or subtract. Accepts a static number or a dynamic field reference.
- Unit: The time unit to apply —
Minute,Hour,Day,Week,Month, orYear.
Example
Adding 7 days to a product's sale end date to extend a promotion by one week.
