Determine Day of Week#
Description#
Determine “Next” Tuesday date (or any day of week).
Snippet#
<mvt:comment>
Logic to determine Next 'Tuesday'
Tuesday is "3""
</mvt:comment>
<mvt:assign name="l.dayofweek" value="3" />
<mvt:assign name="l.today_dow" value="time_t_dayofweek( s.dyn_time_t, g.Merchant_Local_Timezone )" />
<mvt:assign name="l.math" value="( ( l.today_dow - l.dayofweek ) - 7 ) * -1" />
<mvt:assign name="l.next_tuesday" value="mktime_t( s.tm_year, s.tm_mon, s.tm_mday, 0, 0, 0, g.Merchant_Local_Timezone ) + ( 60 * 60 * 24 * l.math )" />
<mvt:assign name="l.months" value="miva_array_deserialize( 'January,February,March,April,May,June,July,August,September,October,November,December' )" />
<mvt:assign name="l.month" value="l.months[ time_t_month( l.next_tuesday, g.Merchant_Local_Timezone ) ]" />
<mvt:assign name="l.day" value="time_t_dayofmonth( l.next_tuesday, g.Merchant_Local_Timezone )" />
<mvt:assign name="g.ships_on_date" value="'Tuesday, ' $ l.month $ ' ' $ l.day" />
&mvt:global:ships_on_date;