"date" Snippets


Basket #63068

 date  math
Get the formatted date one week from now.
Created: 1512430270
View "Basket #63068"
<mvt:do file="g.Module_Library_DB" name="l.success" value="ProductVariantList_Load_Product( l.settings:product:id, l.settings:product:variants )" />
 

Basket #70030

 date  math
Get the formatted date one week from now.
Created: 1512005140
View "Basket #70030"
<mvt:assign name="g.foo" value="'bar'" /> &mvte:global:foo;
 

Basket #67233

 date  math
Get the formatted date one week from now.
Created: 1508948888
View "Basket #67233"
<mvt:assign name="g.current_time" value="s.dyn_time_t" /> <mvt:comment><!-- <mvt:assign name="g.timezone_offset" value="'-4'" /> --></mvt:comment> <mvt:assign name="g.timezone_offset" value="'local'" /> <mvt:assign name="g.duration" value="60 * 60 * 24 * 395" /> <mvt:assign name="g.one_month" value="60 * 60 * 24 * 30" /> <mvt:assign name="g.future_time" value="g.current_time + g.duration"/> <mvt:assign name="g.year" value="time_t_year( g.future_time, g.timezone_offset )" /> <mvt:assign name="g.month" value="padl(time_t_month( g.future_time, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.day" value="padl(time_t_dayofmonth( g.future_time, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.24hour" value="padl(time_t_hour( g.future_time, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.min" value="padl(time_t_min( g.future_time, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.sec" value="padl(time_t_sec( g.future_time, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.formatted_future_date" value="g.year $ '-' $ g.month $ '-' $ g.day $ ' ' $ g.24hour $ ':' $ g.min $ ':' $ g.sec" /> <mvt:assign name="g.time_teste" value="g.future_time - g.current_time"/> <mvt:assign name="g.teste_month" value="floor(g.time_teste/g.one_month)" /> &mvt:global:formatted_future_date; <br> &mvt:global:teste_month;
 

Basket #66538

 date  math
Get the formatted date one week from now.
Created: 1508338358
View "Basket #66538"
<mvt:assign name="g.current_time" value="s.dyn_time_t" /> <mvt:comment><!-- <mvt:assign name="g.timezone_offset" value="'-4'" /> --></mvt:comment> <mvt:assign name="g.timezone_offset" value="'local'" /> <mvt:assign name="g.duration" value="60 * 60 * 24 * 7" /> <mvt:assign name="g.future_time" value="g.current_time + g.duration"/> <mvt:assign name="g.year" value="time_t_year( g.future_time, g.timezone_offset )" /> <mvt:assign name="g.month" value="padl(time_t_month( g.future_time, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.day" value="padl(time_t_dayofmonth( g.future_time, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.24hour" value="padl(time_t_hour( g.future_time, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.min" value="padl(time_t_min( g.future_time, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.sec" value="padl(time_t_sec( g.future_time, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.formatted_future_date" value="g.year $ '-' $ g.month $ '-' $ g.day $ ' ' $ g.24hour $ ':' $ g.min $ ':' $ g.sec" /> &mvt:global:formatted_future_date;
 
View "YYYY-MM-DD to DD/MM/YYYY"
<mvt:assign name="l.settings:event_date:yyyymmdd" value="'2017-09-19'" /> <mvt:do file="g.Module_Library_Utilities" name="l.result" value="SplitString( l.settings:event_date:yyyymmdd, '-', l.settings:event_date:parts )" /> <mvt:if expr="miva_array_elements(l.settings:event_date:parts) EQ 3 AND len(l.settings:event_date:parts[1]) EQ 4"> <mvt:assign name="l.settings:event_date:mmddyyyy" value="l.settings:event_date:parts[2] $ '/' $ l.settings:event_date:parts[3] $ '/' $ l.settings:event_date:parts[1]" /> </mvt:if> <h2>&mvt:event_date:mmddyyyy;</h2> <mvt:eval expr="glosub(miva_array_serialize(l.settings:event_date), ',', '<br>')" />
 

Basket #42796

 date  math
Get the formatted date one week from now.
Created: 1494283731
View "Basket #42796"
<mvt:assign name="g.current_time" value="s.dyn_time_t" /> <mvt:comment><!-- <mvt:assign name="g.timezone_offset" value="'-4'" /> --></mvt:comment> <mvt:assign name="g.timezone_offset" value="'local'" /> <mvt:assign name="g.duration" value="60 * 60 * 24 * 7" /> <mvt:assign name="g.future_time" value="g.current_time + g.duration"/> <mvt:assign name="g.year" value="time_t_year( g.future_time, g.timezone_offset )" /> <mvt:assign name="g.month" value="padl(time_t_month( g.future_time, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.day" value="padl(time_t_dayofmonth( g.future_time, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.24hour" value="padl(time_t_hour( g.future_time, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.min" value="padl(time_t_min( g.future_time, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.sec" value="padl(time_t_sec( g.future_time, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.formatted_future_date" value="g.year $ '-' $ g.month $ '-' $ g.day $ ' ' $ g.24hour $ ':' $ g.min $ ':' $ g.sec" /> &mvt:global:formatted_future_date;<br/> &mvt:global:future_time;
 

Basket #28566

Created: 1480611215
View "Basket #28566"
<mvt:assign name="g.timestamp" value="s.dyn_time_t" /> <mvt:assign name="g.timezone_offset" value="g.Merchant_Local_Timezone" /> <mvt:assign name="g.year" value="time_t_year( g.timestamp, g.timezone_offset )" /> <mvt:assign name="g.month" value="padl(time_t_month( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.day" value="padl(time_t_dayofmonth( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.24hour" value="padl(time_t_hour( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.min" value="padl(time_t_min( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.sec" value="padl(time_t_sec( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.formatted_date" value="g.year $ '-' $ g.month $ '-' $ g.day $ ' ' $ g.24hour $ ':' $ g.min $ ':' $ g.sec" /> Local Timezone = &mvt:global:formatted_date;<br> <mvt:if expr="g.year EQ 2016 AND g.month EQ 12 AND g.day EQ 02"> <mvt:assign name="g.dec1" value=" 'Today is the first.' " /> <mvt:elseif expr="g.year EQ 2016 AND g.month EQ 12 AND g.day EQ 01"> <mvt:assign name="g.dec2" value=" 'Today is the second.' " /> </mvt:if> <mvt:if expr="g.dec1"> Show banner for the first. <mvt:elseif expr="g.dec2"> Show banner for the second. </mvt:if>
 

Basket #28565

Created: 1480611198
View "Basket #28565"
<mvt:assign name="g.timestamp" value="s.dyn_time_t" /> <mvt:assign name="g.timestamp" value="1461778886" /> <mvt:assign name="g.timezone_offset" value="g.Merchant_Local_Timezone" /> <mvt:assign name="g.year" value="time_t_year( g.timestamp, g.timezone_offset )" /> <mvt:assign name="g.month" value="padl(time_t_month( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.day" value="padl(time_t_dayofmonth( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.24hour" value="padl(time_t_hour( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.min" value="padl(time_t_min( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.sec" value="padl(time_t_sec( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.formatted_date" value="g.year $ '-' $ g.month $ '-' $ g.day $ ' ' $ g.24hour $ ':' $ g.min $ ':' $ g.sec" /> Merchant_Local_Timezone = &mvt:global:formatted_date;<br> <mvt:assign name="g.timezone_offset" value="'-3'" /> <mvt:assign name="g.year" value="time_t_year( g.timestamp, g.timezone_offset )" /> <mvt:assign name="g.month" value="padl(time_t_month( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.day" value="padl(time_t_dayofmonth( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.24hour" value="padl(time_t_hour( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.min" value="padl(time_t_min( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.sec" value="padl(time_t_sec( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.formatted_date" value="g.year $ '-' $ g.month $ '-' $ g.day $ ' ' $ g.24hour $ ':' $ g.min $ ':' $ g.sec" /> -3 = &mvt:global:formatted_date;<br> <mvt:assign name="g.timezone_offset" value="'-4'" /> <mvt:assign name="g.year" value="time_t_year( g.timestamp, g.timezone_offset )" /> <mvt:assign name="g.month" value="padl(time_t_month( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.day" value="padl(time_t_dayofmonth( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.24hour" value="padl(time_t_hour( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.min" value="padl(time_t_min( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.sec" value="padl(time_t_sec( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.formatted_date" value="g.year $ '-' $ g.month $ '-' $ g.day $ ' ' $ g.24hour $ ':' $ g.min $ ':' $ g.sec" /> -4 = &mvt:global:formatted_date;<br> <mvt:assign name="g.timezone_offset" value="'-5'" /> <mvt:assign name="g.year" value="time_t_year( g.timestamp, g.timezone_offset )" /> <mvt:assign name="g.month" value="padl(time_t_month( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.day" value="padl(time_t_dayofmonth( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.24hour" value="padl(time_t_hour( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.min" value="padl(time_t_min( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.sec" value="padl(time_t_sec( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.formatted_date" value="g.year $ '-' $ g.month $ '-' $ g.day $ ' ' $ g.24hour $ ':' $ g.min $ ':' $ g.sec" /> -5 = &mvt:global:formatted_date;<br> <mvt:assign name="g.timezone_offset" value="'local'" /> <mvt:assign name="g.year" value="time_t_year( g.timestamp, g.timezone_offset )" /> <mvt:assign name="g.month" value="padl(time_t_month( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.day" value="padl(time_t_dayofmonth( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.24hour" value="padl(time_t_hour( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.min" value="padl(time_t_min( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.sec" value="padl(time_t_sec( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.formatted_date" value="g.year $ '-' $ g.month $ '-' $ g.day $ ' ' $ g.24hour $ ':' $ g.min $ ':' $ g.sec" /> local = &mvt:global:formatted_date;<br>
 
View "Estimate Order Shipping Date"
<mvt:comment> Account for Daylight Savings time </mvt:comment> <mvt:if expr="s.tm_isdst"> <mvt:assign name="g.Timezone_Offset" value="'-5'" /> <mvt:assign name="g.Timezone_Abbreviation" value="'CDT'" /> <mvt:else> <mvt:assign name="g.Timezone_Offset" value="'-6'" /> <mvt:assign name="g.Timezone_Abbreviation" value="'CST'" /> </mvt:if> <mvt:if expr="s.tm_isdst"> <p>Daylight savings time <b>IS</b> in effect. Timezone Offset: &mvte:global:Timezone_Offset;</p> <mvt:else> <p>Daylight savings time is <b>NOT</b> in effect. Timezone Offset: &mvte:global:Timezone_Offset;</p> </mvt:if> <hr> <mvt:comment> Assign a Days-of-the-week text array for later </mvt:comment> <mvt:assign name="l.settings:daysofweek[1]" value="'Sunday'" /> <mvt:assign name="l.settings:daysofweek[2]" value="'Monday'" /> <mvt:assign name="l.settings:daysofweek[3]" value="'Tuesday'" /> <mvt:assign name="l.settings:daysofweek[4]" value="'Wednesday'" /> <mvt:assign name="l.settings:daysofweek[5]" value="'Thursday'" /> <mvt:assign name="l.settings:daysofweek[6]" value="'Friday'" /> <mvt:assign name="l.settings:daysofweek[7]" value="'Saturday'" /> <mvt:comment> Prepare days to simulate & test senarios </mvt:comment> <mvt:assign name="l.settings:senarios[1]:descrip" value="'Monday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[1]:timestamp" value="1470657660" /> <mvt:assign name="l.settings:senarios[2]:descrip" value="'Monday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[2]:timestamp" value="1470693660" /> <mvt:assign name="l.settings:senarios[3]:descrip" value="'Tuesday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[3]:timestamp" value="1470744060" /> <mvt:assign name="l.settings:senarios[4]:descrip" value="'Tuesday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[4]:timestamp" value="1470780060" /> <mvt:assign name="l.settings:senarios[5]:descrip" value="'Wednesday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[5]:timestamp" value="1470830460" /> <mvt:assign name="l.settings:senarios[6]:descrip" value="'Wednesday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[6]:timestamp" value="1470866460" /> <mvt:assign name="l.settings:senarios[7]:descrip" value="'Thursday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[7]:timestamp" value="1470916860" /> <mvt:assign name="l.settings:senarios[8]:descrip" value="'Thursday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[8]:timestamp" value="1470952860" /> <mvt:assign name="l.settings:senarios[9]:descrip" value="'Friday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[9]:timestamp" value="1471003260" /> <mvt:assign name="l.settings:senarios[10]:descrip" value="'Friday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[10]:timestamp" value="1471039260" /> <mvt:assign name="l.settings:senarios[11]:descrip" value="'Saturday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[11]:timestamp" value="1471089660" /> <mvt:assign name="l.settings:senarios[12]:descrip" value="'Saturday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[12]:timestamp" value="1471125660" /> <mvt:assign name="l.settings:senarios[13]:descrip" value="'Sunday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[13]:timestamp" value="1471089660" /> <mvt:assign name="l.settings:senarios[14]:descrip" value="'Sunday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[14]:timestamp" value="1471125660" /> <mvt:comment> Loop over each senario and test the estimation logic </mvt:comment> <mvt:foreach iterator="senario" array="senarios"> <mvt:comment> Assign some date-time variables that make it easier to read, write, and compare dates when we apply the estimation logic </mvt:comment> <mvt:assign name="l.settings:senario:date:year" value="time_t_year( l.settings:senario:timestamp, g.Timezone_Offset )" /> <mvt:assign name="l.settings:senario:date:month" value="padl(time_t_month( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:day" value="padl(time_t_dayofmonth( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:dayofweek" value="time_t_dayofweek( l.settings:senario:timestamp, g.Timezone_Offset )" /> <mvt:assign name="l.settings:senario:date:dayofweek_formatted" value="l.settings:daysofweek[time_t_dayofweek( l.settings:senario:timestamp, g.Timezone_Offset )]" /> <mvt:assign name="l.settings:senario:date:hour" value="padl(time_t_hour( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:min" value="padl(time_t_min( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:sec" value="padl(time_t_sec( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:formatted" value="l.settings:senario:date:year $ '-' $ l.settings:senario:date:month $ '-' $ l.settings:senario:date:day $ ' ' $ l.settings:senario:date:hour $ ':' $ l.settings:senario:date:min $ ':' $ l.settings:senario:date:sec $ ' ' $ g.Timezone_Offset" /> <h2>Senario: &mvt:senario:descrip;<small>&mvt:senario:date:formatted;</small></h2> <mvt:if expr="l.settings:senario:date:dayofweek_formatted CIN 'Monday, Tuesday, Wednesday, Thursday' AND l.settings:senario:date:hour LT 10"> <mvt:comment> Estimation Logic: Ship Today </mvt:comment> <mvt:assign name="l.settings:senario:cutoff:hours" value="10 - l.settings:senario:date:hour" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="60 - l.settings:senario:date:min" /> <mvt:if expr="l.settings:senario:cutoff:minutes EQ 60"> <mvt:assign name="l.settings:senario:cutoff:hours" value="l.settings:senario:cutoff:hours + 1" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="0" /> </mvt:if> <h3>Order within <b>&mvt:senario:cutoff:hours; hours &mvt:senario:cutoff:minutes; minutes</b>, and it should ship today.</h3> <mvt:elseif expr="l.settings:senario:date:dayofweek_formatted CIN 'Monday, Tuesday, Wednesday' AND l.settings:senario:date:hour GE 10"> <mvt:comment> Estimation Logic: Ship Tomorrow </mvt:comment> <mvt:assign name="l.settings:senario:cutoff:hours" value="34 - l.settings:senario:date:hour" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="60 - l.settings:senario:date:min" /> <mvt:if expr="l.settings:senario:cutoff:minutes EQ 60"> <mvt:assign name="l.settings:senario:cutoff:hours" value="l.settings:senario:cutoff:hours + 1" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="0" /> </mvt:if> <mvt:comment><h3>Order within <b>&mvt:senario:cutoff:hours; hours &mvt:senario:cutoff:minutes; minutes</b> and it should ship tomorrow.</h3></mvt:comment> <h3>Order today, and it should ship tomorrow.</h3> <mvt:else> <mvt:comment> Estimation Logic: Ship Monday </mvt:comment> <h3>Order today, and it should ship on Monday.</h3> </mvt:if> <p> <small> <ul> <li>From Monday to Thursday, orders placed <i>before</i> 10am will <b>ship the same day</b></li> <li>From Monday to Wednesday, orders placed <i>after</i> 10am will <b>ship the next day</b></li> <li>All other others (Thursday after 10am to Monday before 10 am) will be <b>shipped on Monday</b>.</li> </ul> </small> </p> <br><hr><br> </mvt:foreach> <mvt:comment> Just a Debugging Helper </mvt:comment> <mvt:comment> <mvt:eval expr="glosub(miva_array_serialize(l.settings:senarios), ',', '<br>')" /> </mvt:comment>
 
View "Estimate Order Shipping Date"
<mvt:comment> Account for Daylight Savings time </mvt:comment> <mvt:if expr="s.tm_isdst"> <mvt:assign name="g.Timezone_Offset" value="'-5'" /> <mvt:assign name="g.Timezone_Abbreviation" value="'CDT'" /> <mvt:else> <mvt:assign name="g.Timezone_Offset" value="'-6'" /> <mvt:assign name="g.Timezone_Abbreviation" value="'CST'" /> </mvt:if> <mvt:if expr="s.tm_isdst"> <p>Daylight savings time <b>IS</b> in effect. Timezone Offset: &mvte:global:Timezone_Offset;</p> <mvt:else> <p>Daylight savings time is <b>NOT</b> in effect. Timezone Offset: &mvte:global:Timezone_Offset;</p> </mvt:if> <hr> <mvt:comment> Assign a Days-of-the-week text array for later </mvt:comment> <mvt:assign name="l.settings:daysofweek[1]" value="'Sunday'" /> <mvt:assign name="l.settings:daysofweek[2]" value="'Monday'" /> <mvt:assign name="l.settings:daysofweek[3]" value="'Tuesday'" /> <mvt:assign name="l.settings:daysofweek[4]" value="'Wednesday'" /> <mvt:assign name="l.settings:daysofweek[5]" value="'Thursday'" /> <mvt:assign name="l.settings:daysofweek[6]" value="'Friday'" /> <mvt:assign name="l.settings:daysofweek[7]" value="'Saturday'" /> <mvt:comment> Prepare days to simulate & test senarios </mvt:comment> <mvt:assign name="l.settings:senarios[1]:descrip" value="'Monday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[1]:timestamp" value="1470657660" /> <mvt:assign name="l.settings:senarios[2]:descrip" value="'Monday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[2]:timestamp" value="1470693660" /> <mvt:assign name="l.settings:senarios[3]:descrip" value="'Tuesday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[3]:timestamp" value="1470744060" /> <mvt:assign name="l.settings:senarios[4]:descrip" value="'Tuesday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[4]:timestamp" value="1470780060" /> <mvt:assign name="l.settings:senarios[5]:descrip" value="'Wednesday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[5]:timestamp" value="1470830460" /> <mvt:assign name="l.settings:senarios[6]:descrip" value="'Wednesday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[6]:timestamp" value="1470866460" /> <mvt:assign name="l.settings:senarios[7]:descrip" value="'Thursday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[7]:timestamp" value="1470916860" /> <mvt:assign name="l.settings:senarios[8]:descrip" value="'Thursday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[8]:timestamp" value="1470952860" /> <mvt:assign name="l.settings:senarios[9]:descrip" value="'Friday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[9]:timestamp" value="1471003260" /> <mvt:assign name="l.settings:senarios[10]:descrip" value="'Friday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[10]:timestamp" value="1471039260" /> <mvt:assign name="l.settings:senarios[11]:descrip" value="'Saturday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[11]:timestamp" value="1471089660" /> <mvt:assign name="l.settings:senarios[12]:descrip" value="'Saturday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[12]:timestamp" value="1471125660" /> <mvt:assign name="l.settings:senarios[13]:descrip" value="'Sunday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[13]:timestamp" value="1471089660" /> <mvt:assign name="l.settings:senarios[14]:descrip" value="'Sunday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[14]:timestamp" value="1471125660" /> <mvt:comment> Loop over each senario and test the estimation logic </mvt:comment> <mvt:foreach iterator="senario" array="senarios"> <mvt:comment> Assign some date-time variables that make it easier to read, write, and compare dates when we apply the estimation logic </mvt:comment> <mvt:assign name="l.settings:senario:date:year" value="time_t_year( l.settings:senario:timestamp, g.Timezone_Offset )" /> <mvt:assign name="l.settings:senario:date:month" value="padl(time_t_month( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:day" value="padl(time_t_dayofmonth( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:dayofweek" value="time_t_dayofweek( l.settings:senario:timestamp, g.Timezone_Offset )" /> <mvt:assign name="l.settings:senario:date:dayofweek_formatted" value="l.settings:daysofweek[time_t_dayofweek( l.settings:senario:timestamp, g.Timezone_Offset )]" /> <mvt:assign name="l.settings:senario:date:24hour" value="padl(time_t_hour( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:min" value="padl(time_t_min( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:sec" value="padl(time_t_sec( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:formatted" value="l.settings:senario:date:year $ '-' $ l.settings:senario:date:month $ '-' $ l.settings:senario:date:day $ ' ' $ l.settings:senario:date:24hour $ ':' $ l.settings:senario:date:min $ ':' $ l.settings:senario:date:sec $ ' ' $ g.Timezone_Offset" /> <h2 style='color: gray'> Senario #<mvt:eval expr="POS1"/>: &mvt:senario:descrip; <small>&mvt:senario:date:formatted;</small> </h2> <mvt:if expr="l.settings:senario:date:dayofweek_formatted CIN 'Monday, Tuesday, Wednesday, Thursday' AND l.settings:senario:date:24hour LT 10"> <mvt:comment> Estimation Logic: Ship Today </mvt:comment> <mvt:assign name="l.settings:senario:cutoff:hours" value="10 - l.settings:senario:date:24hour" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="60 - l.settings:senario:date:min" /> <mvt:if expr="l.settings:senario:cutoff:minutes EQ 60"> <mvt:assign name="l.settings:senario:cutoff:hours" value="l.settings:senario:cutoff:hours + 1" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="0" /> </mvt:if> <h3>Order within <b>&mvt:senario:cutoff:hours; hours &mvt:senario:cutoff:minutes; minutes</b>, and it should ship today.</h3> <mvt:elseif expr="l.settings:senario:date:dayofweek_formatted CIN 'Monday, Tuesday, Wednesday' AND l.settings:senario:date:24hour GE 10"> <mvt:comment> Estimation Logic: Ship Tomorrow </mvt:comment> <mvt:assign name="l.settings:senario:cutoff:hours" value="34 - l.settings:senario:date:24hour" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="60 - l.settings:senario:date:min" /> <mvt:if expr="l.settings:senario:cutoff:minutes EQ 60"> <mvt:assign name="l.settings:senario:cutoff:hours" value="l.settings:senario:cutoff:hours + 1" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="0" /> </mvt:if> <mvt:comment><h3>Order within <b>&mvt:senario:cutoff:hours; hours &mvt:senario:cutoff:minutes; minutes</b> and it should ship tomorrow.</h3></mvt:comment> <h3>Order today, and it should ship tomorrow.</h3> <mvt:else> <mvt:comment> Estimation Logic: Ship Monday </mvt:comment> <h3>Order today, and it should ship on Monday.</h3> </mvt:if> <p> <small> <ul> <li>From Monday to Thursday, orders placed <i>before</i> 10am will ship the same day.</li> <li>From Monday to Wednesday, orders placed <i>after</i> 10am will ship the next day.</li> <li>All other others (Thursday after 10am to Monday before 10 am) will be shipped on Monday.</li> </ul> </small> </p> <br><br><hr><br><br> </mvt:foreach> <mvt:comment> Just a Debugging Helper </mvt:comment> <mvt:comment><mvt:eval expr="glosub(miva_array_serialize(l.settings:senarios), ',', '<br>')" /></mvt:comment>
 
View "Estimate Order Shipping Date"
<mvt:comment> Account for Daylight Savings time </mvt:comment> <mvt:if expr="s.tm_isdst"> <mvt:assign name="g.Timezone_Offset" value="'-5'" /> <mvt:assign name="g.Timezone_Abbreviation" value="'CDT'" /> <mvt:else> <mvt:assign name="g.Timezone_Offset" value="'-6'" /> <mvt:assign name="g.Timezone_Abbreviation" value="'CST'" /> </mvt:if> <mvt:if expr="s.tm_isdst"> <p>Daylight savings time <b>IS</b> in effect. Timezone Offset: &mvte:global:Timezone_Offset;</p> <mvt:else> <p>Daylight savings time is <b>NOT</b> in effect. Timezone Offset: &mvte:global:Timezone_Offset;</p> </mvt:if> <hr> <mvt:comment> Assign a Days-of-the-week text array for later </mvt:comment> <mvt:assign name="l.settings:daysofweek[1]" value="'Sunday'" /> <mvt:assign name="l.settings:daysofweek[2]" value="'Monday'" /> <mvt:assign name="l.settings:daysofweek[3]" value="'Tuesday'" /> <mvt:assign name="l.settings:daysofweek[4]" value="'Wednesday'" /> <mvt:assign name="l.settings:daysofweek[5]" value="'Thursday'" /> <mvt:assign name="l.settings:daysofweek[6]" value="'Friday'" /> <mvt:assign name="l.settings:daysofweek[7]" value="'Saturday'" /> <mvt:comment> Prepare days to simulate & test senarios </mvt:comment> <mvt:assign name="l.settings:senarios[1]:descrip" value="'Monday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[1]:timestamp" value="1470657660" /> <mvt:assign name="l.settings:senarios[2]:descrip" value="'Monday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[2]:timestamp" value="1470693660" /> <mvt:assign name="l.settings:senarios[3]:descrip" value="'Tuesday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[3]:timestamp" value="1470744060" /> <mvt:assign name="l.settings:senarios[4]:descrip" value="'Tuesday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[4]:timestamp" value="1470780060" /> <mvt:assign name="l.settings:senarios[5]:descrip" value="'Wednesday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[5]:timestamp" value="1470830460" /> <mvt:assign name="l.settings:senarios[6]:descrip" value="'Wednesday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[6]:timestamp" value="1470866460" /> <mvt:assign name="l.settings:senarios[7]:descrip" value="'Thursday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[7]:timestamp" value="1470916860" /> <mvt:assign name="l.settings:senarios[8]:descrip" value="'Thursday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[8]:timestamp" value="1470952860" /> <mvt:assign name="l.settings:senarios[9]:descrip" value="'Friday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[9]:timestamp" value="1471003260" /> <mvt:assign name="l.settings:senarios[10]:descrip" value="'Friday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[10]:timestamp" value="1471039260" /> <mvt:assign name="l.settings:senarios[11]:descrip" value="'Saturday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[11]:timestamp" value="1471089660" /> <mvt:assign name="l.settings:senarios[12]:descrip" value="'Saturday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[12]:timestamp" value="1471125660" /> <mvt:assign name="l.settings:senarios[13]:descrip" value="'Sunday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[13]:timestamp" value="1471089660" /> <mvt:assign name="l.settings:senarios[14]:descrip" value="'Sunday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[14]:timestamp" value="1471125660" /> <mvt:comment> Loop over each senario and test the estimation logic </mvt:comment> <mvt:foreach iterator="senario" array="senarios"> <mvt:comment> Assign some date-time variables that make it easier to read, write, and compare dates when we apply the estimation logic </mvt:comment> <mvt:assign name="l.settings:senario:date:year" value="time_t_year( l.settings:senario:timestamp, g.Timezone_Offset )" /> <mvt:assign name="l.settings:senario:date:month" value="padl(time_t_month( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:day" value="padl(time_t_dayofmonth( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:dayofweek" value="time_t_dayofweek( l.settings:senario:timestamp, g.Timezone_Offset )" /> <mvt:assign name="l.settings:senario:date:dayofweek_formatted" value="l.settings:daysofweek[time_t_dayofweek( l.settings:senario:timestamp, g.Timezone_Offset )]" /> <mvt:assign name="l.settings:senario:date:24hour" value="padl(time_t_hour( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:min" value="padl(time_t_min( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:sec" value="padl(time_t_sec( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:formatted" value="l.settings:senario:date:year $ '-' $ l.settings:senario:date:month $ '-' $ l.settings:senario:date:day $ ' ' $ l.settings:senario:date:24hour $ ':' $ l.settings:senario:date:min $ ':' $ l.settings:senario:date:sec $ ' ' $ g.Timezone_Offset" /> <h2 style='color: gray'> Senario #<mvt:eval expr="POS1"/>: &mvt:senario:descrip; <small>&mvt:senario:date:formatted;</small> </h2> <mvt:if expr="l.settings:senario:date:dayofweek_formatted CIN 'Monday, Tuesday, Wednesday, Thursday' AND l.settings:senario:date:24hour LT 10"> <mvt:comment> Estimation Logic: Ship Today </mvt:comment> <mvt:assign name="l.settings:senario:cutoff:hours" value="10 - l.settings:senario:date:24hour" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="60 - l.settings:senario:date:min" /> <mvt:if expr="l.settings:senario:cutoff:minutes EQ 60"> <mvt:assign name="l.settings:senario:cutoff:hours" value="l.settings:senario:cutoff:hours + 1" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="0" /> </mvt:if> <h3>Order within <b>&mvt:senario:cutoff:hours; hours &mvt:senario:cutoff:minutes; minutes</b>, and it should ship today.</h3> <mvt:elseif expr="l.settings:senario:date:dayofweek_formatted CIN 'Monday, Tuesday, Wednesday' AND l.settings:senario:date:24hour GE 10"> <mvt:comment> Estimation Logic: Ship Tomorrow </mvt:comment> <mvt:assign name="l.settings:senario:cutoff:hours" value="34 - l.settings:senario:date:24hour" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="60 - l.settings:senario:date:min" /> <mvt:if expr="l.settings:senario:cutoff:minutes EQ 60"> <mvt:assign name="l.settings:senario:cutoff:hours" value="l.settings:senario:cutoff:hours + 1" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="0" /> </mvt:if> <mvt:comment><h3>Order within <b>&mvt:senario:cutoff:hours; hours &mvt:senario:cutoff:minutes; minutes</b> and it should ship tomorrow.</h3></mvt:comment> <h3>Order today, and it should ship tomorrow.</h3> <mvt:else> <mvt:comment> Estimation Logic: Ship Monday </mvt:comment> <h3>Order today, and it should ship on Monday.</h3> </mvt:if> <p> <small> <ul> <li>From Monday to Thursday, orders placed <i>before</i> 10am will ship the same day.</li> <li>From Monday to Wednesday, orders placed <i>after</i> 10am will ship the next day.</li> <li>All other others (Thursday after 10am to Monday before 10 am) will be shipped on Monday.</li> </ul> </small> </p> <br><br><hr><br><br> </mvt:foreach> <mvt:comment> Just a Debugging Helper </mvt:comment> <mvt:eval expr="glosub(miva_array_serialize(l.settings:senarios), ',', '<br>')" />
 
View "Estimate Order Shipping Date"
<mvt:comment> Account for Daylight Savings time </mvt:comment> <mvt:if expr="s.tm_isdst"> <mvt:assign name="g.Timezone_Offset" value="'-5'" /> <mvt:assign name="g.Timezone_Abbreviation" value="'CDT'" /> <mvt:else> <mvt:assign name="g.Timezone_Offset" value="'-6'" /> <mvt:assign name="g.Timezone_Abbreviation" value="'CST'" /> </mvt:if> <mvt:if expr="s.tm_isdst"> <p>Daylight savings time <b>IS</b> in effect. Timezone Offset: &mvte:global:Timezone_Offset;</p> <mvt:else> <p>Daylight savings time is <b>NOT</b> in effect. Timezone Offset: &mvte:global:Timezone_Offset;</p> </mvt:if> <hr> <mvt:comment> Assign a Days-of-the-week text array for later </mvt:comment> <mvt:assign name="l.settings:daysofweek[1]" value="'Sunday'" /> <mvt:assign name="l.settings:daysofweek[2]" value="'Monday'" /> <mvt:assign name="l.settings:daysofweek[3]" value="'Tuesday'" /> <mvt:assign name="l.settings:daysofweek[4]" value="'Wednesday'" /> <mvt:assign name="l.settings:daysofweek[5]" value="'Thursday'" /> <mvt:assign name="l.settings:daysofweek[6]" value="'Friday'" /> <mvt:assign name="l.settings:daysofweek[7]" value="'Saturday'" /> <mvt:comment> Prepare days to simulate & test senarios </mvt:comment> <mvt:assign name="l.settings:senarios[1]:descrip" value="'Monday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[1]:timestamp" value="1470657660" /> <mvt:assign name="l.settings:senarios[2]:descrip" value="'Monday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[2]:timestamp" value="1470693660" /> <mvt:assign name="l.settings:senarios[3]:descrip" value="'Tuesday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[3]:timestamp" value="1470744060" /> <mvt:assign name="l.settings:senarios[4]:descrip" value="'Tuesday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[4]:timestamp" value="1470780060" /> <mvt:assign name="l.settings:senarios[5]:descrip" value="'Wednesday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[5]:timestamp" value="1470830460" /> <mvt:assign name="l.settings:senarios[6]:descrip" value="'Wednesday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[6]:timestamp" value="1470866460" /> <mvt:assign name="l.settings:senarios[7]:descrip" value="'Thursday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[7]:timestamp" value="1470916860" /> <mvt:assign name="l.settings:senarios[8]:descrip" value="'Thursday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[8]:timestamp" value="1470952860" /> <mvt:assign name="l.settings:senarios[9]:descrip" value="'Friday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[9]:timestamp" value="1471003260" /> <mvt:assign name="l.settings:senarios[10]:descrip" value="'Friday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[10]:timestamp" value="1471039260" /> <mvt:assign name="l.settings:senarios[11]:descrip" value="'Saturday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[11]:timestamp" value="1471089660" /> <mvt:assign name="l.settings:senarios[12]:descrip" value="'Saturday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[12]:timestamp" value="1471125660" /> <mvt:assign name="l.settings:senarios[13]:descrip" value="'Sunday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[13]:timestamp" value="1471089660" /> <mvt:assign name="l.settings:senarios[14]:descrip" value="'Sunday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[14]:timestamp" value="1471125660" /> <mvt:comment> Loop over each senario and test the estimation logic </mvt:comment> <mvt:foreach iterator="senario" array="senarios"> <mvt:comment> Assign some date-time variables that make it easier to read, write, and compare dates when we apply the estimation logic </mvt:comment> <mvt:assign name="l.settings:senario:date:year" value="time_t_year( l.settings:senario:timestamp, g.Timezone_Offset )" /> <mvt:assign name="l.settings:senario:date:month" value="padl(time_t_month( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:day" value="padl(time_t_dayofmonth( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:dayofweek" value="time_t_dayofweek( l.settings:senario:timestamp, g.Timezone_Offset )" /> <mvt:assign name="l.settings:senario:date:dayofweek_formatted" value="l.settings:daysofweek[time_t_dayofweek( l.settings:senario:timestamp, g.Timezone_Offset )]" /> <mvt:assign name="l.settings:senario:date:24hour" value="padl(time_t_hour( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:min" value="padl(time_t_min( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:sec" value="padl(time_t_sec( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:formatted" value="l.settings:senario:date:year $ '-' $ l.settings:senario:date:month $ '-' $ l.settings:senario:date:day $ ' ' $ l.settings:senario:date:24hour $ ':' $ l.settings:senario:date:min $ ':' $ l.settings:senario:date:sec $ ' ' $ g.Timezone_Offset" /> <h2 style='color: gray'> Senario #<mvt:eval expr="POS1"/>: &mvt:senario:descrip; <small>&mvt:senario:date:formatted;</small> </h2> <mvt:if expr="l.settings:senario:date:dayofweek_formatted CIN 'Monday, Tuesday, Wednesday, Thursday' AND l.settings:senario:date:24hour LT 10"> <mvt:comment> Estimation Logic: Ship Today </mvt:comment> <mvt:assign name="l.settings:senario:cutoff:hours" value="10 - l.settings:senario:date:24hour" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="60 - l.settings:senario:date:min" /> <mvt:if expr="l.settings:senario:cutoff:minutes EQ 60"> <mvt:assign name="l.settings:senario:cutoff:hours" value="l.settings:senario:cutoff:hours + 1" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="0" /> </mvt:if> <h3>Order within <b>&mvt:senario:cutoff:hours; hours &mvt:senario:cutoff:minutes; minutes</b>, and it should ship today.</h3> <mvt:elseif expr="l.settings:senario:date:dayofweek_formatted CIN 'Monday, Tuesday, Wednesday' AND l.settings:senario:date:24hour GE 10"> <mvt:comment> Estimation Logic: Ship Tomorrow </mvt:comment> <mvt:assign name="l.settings:senario:cutoff:hours" value="34 - l.settings:senario:date:24hour" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="60 - l.settings:senario:date:min" /> <mvt:if expr="l.settings:senario:cutoff:minutes EQ 60"> <mvt:assign name="l.settings:senario:cutoff:hours" value="l.settings:senario:cutoff:hours + 1" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="0" /> </mvt:if> <mvt:comment><h3>Order within <b>&mvt:senario:cutoff:hours; hours &mvt:senario:cutoff:minutes; minutes</b> and it should ship tomorrow.</h3></mvt:comment> <h3>Order today, and it should ship tomorrow.</h3> <mvt:else> <mvt:comment> Estimation Logic: Ship Monday </mvt:comment> <h3>Order today, and it should ship on Monday.</h3> </mvt:if> <p> <small> <ul> <li>From Monday to Thursday, orders placed <i>before</i> 10am will <b>ship the same day</b></li> <li>From Monday to Wednesday, orders placed <i>after</i> 10am will <b>ship the next day</b></li> <li>All other others (Thursday after 10am to Monday before 10 am) will be <b>shipped on Monday</b>.</li> </ul> </small> </p> <br><hr><br> </mvt:foreach> <mvt:comment> Just a Debugging Helper </mvt:comment> <mvt:eval expr="glosub(miva_array_serialize(l.settings:senarios), ',', '<br>')" />
 
View "Estimate Order Shipping Date"
<mvt:if expr="s.tm_isdst"> <mvt:assign name="g.Timezone_Offset" value="'-5'" /> <mvt:assign name="g.Timezone_Abbreviation" value="'CDT'" /> <mvt:else> <mvt:assign name="g.Timezone_Offset" value="'-6'" /> <mvt:assign name="g.Timezone_Abbreviation" value="'CST'" /> </mvt:if> <mvt:if expr="s.tm_isdst"> <p>Daylight savings time <b>IS</b> in effect. Timezone Offset: &mvte:global:Timezone_Offset;</p> <mvt:else> <p>Daylight savings time is <b>NOT</b> in effect. Timezone Offset: &mvte:global:Timezone_Offset;</p> </mvt:if> <mvt:assign name="l.settings:daysofweek[1]" value="'Sunday'" /> <mvt:assign name="l.settings:daysofweek[2]" value="'Monday'" /> <mvt:assign name="l.settings:daysofweek[3]" value="'Tuesday'" /> <mvt:assign name="l.settings:daysofweek[4]" value="'Wednesday'" /> <mvt:assign name="l.settings:daysofweek[5]" value="'Thursday'" /> <mvt:assign name="l.settings:daysofweek[6]" value="'Friday'" /> <mvt:assign name="l.settings:daysofweek[7]" value="'Saturday'" /> <hr> <mvt:assign name="l.settings:senarios[1]:descrip" value="'Monday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[1]:timestamp" value="1470657660" /> <mvt:assign name="l.settings:senarios[2]:descrip" value="'Monday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[2]:timestamp" value="1470693660" /> <mvt:assign name="l.settings:senarios[3]:descrip" value="'Tuesday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[3]:timestamp" value="1470744060" /> <mvt:assign name="l.settings:senarios[4]:descrip" value="'Tuesday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[4]:timestamp" value="1470780060" /> <mvt:assign name="l.settings:senarios[5]:descrip" value="'Wednesday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[5]:timestamp" value="1470830460" /> <mvt:assign name="l.settings:senarios[6]:descrip" value="'Wednesday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[6]:timestamp" value="1470866460" /> <mvt:assign name="l.settings:senarios[7]:descrip" value="'Thursday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[7]:timestamp" value="1470916860" /> <mvt:assign name="l.settings:senarios[8]:descrip" value="'Thursday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[8]:timestamp" value="1470952860" /> <mvt:assign name="l.settings:senarios[9]:descrip" value="'Friday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[9]:timestamp" value="1471003260" /> <mvt:assign name="l.settings:senarios[10]:descrip" value="'Friday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[10]:timestamp" value="1471039260" /> <mvt:assign name="l.settings:senarios[11]:descrip" value="'Saturday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[11]:timestamp" value="1471089660" /> <mvt:assign name="l.settings:senarios[12]:descrip" value="'Saturday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[12]:timestamp" value="1471125660" /> <mvt:assign name="l.settings:senarios[13]:descrip" value="'Sunday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[13]:timestamp" value="1471089660" /> <mvt:assign name="l.settings:senarios[14]:descrip" value="'Sunday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[14]:timestamp" value="1471125660" /> <mvt:foreach iterator="senario" array="senarios"> <mvt:assign name="l.settings:senario:date:year" value="time_t_year( l.settings:senario:timestamp, g.Timezone_Offset )" /> <mvt:assign name="l.settings:senario:date:month" value="padl(time_t_month( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:day" value="padl(time_t_dayofmonth( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:dayofweek" value="time_t_dayofweek( l.settings:senario:timestamp, g.Timezone_Offset )" /> <mvt:assign name="l.settings:senario:date:dayofweek_formatted" value="l.settings:daysofweek[time_t_dayofweek( l.settings:senario:timestamp, g.Timezone_Offset )]" /> <mvt:assign name="l.settings:senario:date:24hour" value="padl(time_t_hour( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:min" value="padl(time_t_min( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:sec" value="padl(time_t_sec( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:formatted" value="l.settings:senario:date:year $ '-' $ l.settings:senario:date:month $ '-' $ l.settings:senario:date:day $ ' ' $ l.settings:senario:date:24hour $ ':' $ l.settings:senario:date:min $ ':' $ l.settings:senario:date:sec $ ' ' $ g.Timezone_Offset" /> <h2 style="color: gray;">Senario #<mvt:eval expr="POS1"/>: &mvt:senario:descrip; <small>&mvt:senario:date:formatted;</small></h2> <mvt:if expr="l.settings:senario:date:dayofweek_formatted CIN 'Monday, Tuesday, Wednesday, Thursday' AND l.settings:senario:date:24hour LT 10"> <mvt:comment> Ship Today </mvt:comment> <mvt:assign name="l.settings:senario:cutoff:hours" value="10 - l.settings:senario:date:24hour" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="60 - l.settings:senario:date:min" /> <mvt:if expr="l.settings:senario:cutoff:minutes EQ 60"> <mvt:assign name="l.settings:senario:cutoff:hours" value="l.settings:senario:cutoff:hours + 1" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="0" /> </mvt:if> <h3>Order within <b>&mvt:senario:cutoff:hours; hours &mvt:senario:cutoff:minutes; minutes</b> and it should ship today.</h3> <mvt:elseif expr="l.settings:senario:date:dayofweek_formatted CIN 'Monday, Tuesday, Wednesday' AND l.settings:senario:date:24hour GE 10"> <mvt:comment> | Ship Tomorrow </mvt:comment> <mvt:assign name="l.settings:senario:cutoff:hours" value="34 - l.settings:senario:date:24hour" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="60 - l.settings:senario:date:min" /> <mvt:if expr="l.settings:senario:cutoff:minutes EQ 60"> <mvt:assign name="l.settings:senario:cutoff:hours" value="l.settings:senario:cutoff:hours + 1" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="0" /> </mvt:if> <mvt:comment><h3>Order within <b>&mvt:senario:cutoff:hours; hours &mvt:senario:cutoff:minutes; minutes</b> and it should ship tomorrow.</h3></mvt:comment> <h3>Order today and it should ship tomorrow.</h3> <mvt:else> <mvt:comment> Ship Monday </mvt:comment> <h3>Order today and it should ship monday.</h3> </mvt:if> <p> <small> <ul> <li>From Monday to Thursday, orders placed <i>before</i> 10am will <b>ship the same day</b></li> <li>From Monday to Wednesday, orders placed <i>after</i> 10am will <b>ship the next day</b></li> <li>All other others (Thursday after 10am to Monday before 10 am) will be <b>shipped on Monday</b>.</li> </ul> </small> </p> <br><hr><br> </mvt:foreach> <mvt:eval expr="glosub(miva_array_serialize(l.settings:senarios), ',', '<br>')" />
 

Basket #18686

Created: 1467209265
View "Basket #18686"
<mvt:assign name="g.timestamp" value="s.dyn_time_t" /> <mvt:assign name="g.timezone_offset" value="g.Merchant_Local_Timezone" /> <mvt:assign name="g.year" value="time_t_year( g.timestamp, g.timezone_offset )" /> <mvt:assign name="g.month" value="padl(time_t_month( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.day" value="padl(time_t_dayofmonth( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.24hour" value="padl(time_t_hour( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.min" value="padl(time_t_min( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.sec" value="padl(time_t_sec( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.formatted_date" value="g.year $ '-' $ g.month $ '-' $ g.day $ ' ' $ g.24hour $ ':' $ g.min $ ':' $ g.sec" /> Merchant_Local_Timezone = &mvt:global:formatted_date;<br> <mvt:assign name="g.timezone_offset" value="'-3'" /> <mvt:assign name="g.year" value="time_t_year( g.timestamp, g.timezone_offset )" /> <mvt:assign name="g.month" value="padl(time_t_month( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.day" value="padl(time_t_dayofmonth( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.24hour" value="padl(time_t_hour( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.min" value="padl(time_t_min( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.sec" value="padl(time_t_sec( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.formatted_date" value="g.year $ '-' $ g.month $ '-' $ g.day $ ' ' $ g.24hour $ ':' $ g.min $ ':' $ g.sec" /> -3 = &mvt:global:formatted_date;<br> <mvt:assign name="g.timezone_offset" value="'-4'" /> <mvt:assign name="g.year" value="time_t_year( g.timestamp, g.timezone_offset )" /> <mvt:assign name="g.month" value="padl(time_t_month( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.day" value="padl(time_t_dayofmonth( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.24hour" value="padl(time_t_hour( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.min" value="padl(time_t_min( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.sec" value="padl(time_t_sec( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.formatted_date" value="g.year $ '-' $ g.month $ '-' $ g.day $ ' ' $ g.24hour $ ':' $ g.min $ ':' $ g.sec" /> -4 = &mvt:global:formatted_date;<br> <mvt:assign name="g.timezone_offset" value="'-5'" /> <mvt:assign name="g.year" value="time_t_year( g.timestamp, g.timezone_offset )" /> <mvt:assign name="g.month" value="padl(time_t_month( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.day" value="padl(time_t_dayofmonth( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.24hour" value="padl(time_t_hour( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.min" value="padl(time_t_min( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.sec" value="padl(time_t_sec( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.formatted_date" value="g.year $ '-' $ g.month $ '-' $ g.day $ ' ' $ g.24hour $ ':' $ g.min $ ':' $ g.sec" /> -5 = &mvt:global:formatted_date;<br> <mvt:assign name="g.timezone_offset" value="'local'" /> <mvt:assign name="g.year" value="time_t_year( g.timestamp, g.timezone_offset )" /> <mvt:assign name="g.month" value="padl(time_t_month( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.day" value="padl(time_t_dayofmonth( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.24hour" value="padl(time_t_hour( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.min" value="padl(time_t_min( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.sec" value="padl(time_t_sec( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.formatted_date" value="g.year $ '-' $ g.month $ '-' $ g.day $ ' ' $ g.24hour $ ':' $ g.min $ ':' $ g.sec" /> local = &mvt:global:formatted_date;<br>
 
View "Dates & Times with Various Timezone Methods"
<mvt:assign name="g.timestamp" value="s.dyn_time_t" /> <mvt:assign name="g.timestamp" value="1461778886" /> <mvt:assign name="g.timezone_offset" value="g.Merchant_Local_Timezone" /> <mvt:assign name="g.year" value="time_t_year( g.timestamp, g.timezone_offset )" /> <mvt:assign name="g.month" value="padl(time_t_month( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.day" value="padl(time_t_dayofmonth( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.24hour" value="padl(time_t_hour( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.min" value="padl(time_t_min( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.sec" value="padl(time_t_sec( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.formatted_date" value="g.year $ '-' $ g.month $ '-' $ g.day $ ' ' $ g.24hour $ ':' $ g.min $ ':' $ g.sec" /> Merchant_Local_Timezone = &mvt:global:formatted_date;<br> <mvt:assign name="g.timezone_offset" value="'-3'" /> <mvt:assign name="g.year" value="time_t_year( g.timestamp, g.timezone_offset )" /> <mvt:assign name="g.month" value="padl(time_t_month( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.day" value="padl(time_t_dayofmonth( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.24hour" value="padl(time_t_hour( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.min" value="padl(time_t_min( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.sec" value="padl(time_t_sec( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.formatted_date" value="g.year $ '-' $ g.month $ '-' $ g.day $ ' ' $ g.24hour $ ':' $ g.min $ ':' $ g.sec" /> -3 = &mvt:global:formatted_date;<br> <mvt:assign name="g.timezone_offset" value="'-4'" /> <mvt:assign name="g.year" value="time_t_year( g.timestamp, g.timezone_offset )" /> <mvt:assign name="g.month" value="padl(time_t_month( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.day" value="padl(time_t_dayofmonth( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.24hour" value="padl(time_t_hour( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.min" value="padl(time_t_min( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.sec" value="padl(time_t_sec( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.formatted_date" value="g.year $ '-' $ g.month $ '-' $ g.day $ ' ' $ g.24hour $ ':' $ g.min $ ':' $ g.sec" /> -4 = &mvt:global:formatted_date;<br> <mvt:assign name="g.timezone_offset" value="'-5'" /> <mvt:assign name="g.year" value="time_t_year( g.timestamp, g.timezone_offset )" /> <mvt:assign name="g.month" value="padl(time_t_month( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.day" value="padl(time_t_dayofmonth( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.24hour" value="padl(time_t_hour( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.min" value="padl(time_t_min( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.sec" value="padl(time_t_sec( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.formatted_date" value="g.year $ '-' $ g.month $ '-' $ g.day $ ' ' $ g.24hour $ ':' $ g.min $ ':' $ g.sec" /> -5 = &mvt:global:formatted_date;<br> <mvt:assign name="g.timezone_offset" value="'local'" /> <mvt:assign name="g.year" value="time_t_year( g.timestamp, g.timezone_offset )" /> <mvt:assign name="g.month" value="padl(time_t_month( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.day" value="padl(time_t_dayofmonth( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.24hour" value="padl(time_t_hour( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.min" value="padl(time_t_min( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.sec" value="padl(time_t_sec( g.timestamp, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.formatted_date" value="g.year $ '-' $ g.month $ '-' $ g.day $ ' ' $ g.24hour $ ':' $ g.min $ ':' $ g.sec" /> local = &mvt:global:formatted_date;<br>
 

Basket #15788

Created: 1460056611
View "Basket #15788"
<mvt:comment><!-- Days --></mvt:comment> <mvt:assign name="g.timezone_offset" value="'local'" /> <mvt:assign name="l.settings:days[1]:name" value="'Sunday'" /> <mvt:assign name="l.settings:days[1]:time" value="1431284400" /> <mvt:assign name="l.settings:days[2]:name" value="'Monday'" /> <mvt:assign name="l.settings:days[2]:time" value="1431370800" /> <mvt:assign name="l.settings:days[3]:name" value="'Tuesday'" /> <mvt:assign name="l.settings:days[3]:time" value="1431457200" /> <mvt:assign name="l.settings:days[4]:name" value="'Wednesday'" /> <mvt:assign name="l.settings:days[4]:time" value="1431543600" /> <mvt:assign name="l.settings:days[5]:name" value="'Thursday'" /> <mvt:assign name="l.settings:days[5]:time" value="1431630000" /> <mvt:assign name="l.settings:days[6]:name" value="'Friday'" /> <mvt:assign name="l.settings:days[6]:time" value="1431716400" /> <mvt:assign name="l.settings:days[7]:name" value="'Saturday'" /> <mvt:assign name="l.settings:days[7]:time" value="1431802800" /> <mvt:comment><!-- Shipping Methods --></mvt:comment> <mvt:assign name="l.settings:shippingmethods[1]:name" value="'Next Day'" /> <mvt:assign name="l.settings:shippingmethods[1]:delivery:min" value="1" /> <mvt:assign name="l.settings:shippingmethods[1]:delivery:max" value="1" /> <mvt:assign name="l.settings:shippingmethods[2]:name" value="'2nd Day'" /> <mvt:assign name="l.settings:shippingmethods[2]:delivery:min" value="2" /> <mvt:assign name="l.settings:shippingmethods[2]:delivery:max" value="2" /> <mvt:assign name="l.settings:shippingmethods[3]:name" value="'Ground'" /> <mvt:assign name="l.settings:shippingmethods[3]:delivery:min" value="7" /> <mvt:assign name="l.settings:shippingmethods[3]:delivery:max" value="10" /> <mvt:foreach iterator="day" array="days"> <mvt:assign name="l.settings:day:month" value="time_t_month( l.settings:day:time, g.timezone_offset )" /> <mvt:assign name="l.settings:day:day" value="time_t_dayofmonth( l.settings:day:time, g.timezone_offset )" /> <mvt:assign name="l.settings:day:formatted_date" value="l.settings:day:month $ '/' $ l.settings:day:day" /> <h2>Order Placed: &mvt:day:name; @ &mvt:day:formatted_date;</h2> <mvt:foreach iterator="method" array="shippingmethods"> <mvt:assign name="l.settings:method:elapsed:days" value="0" /> <mvt:assign name="l.settings:method:shipping:days" value="0" /> <mvt:assign name="l.settings:method:processing:days" value="4" /> <mvt:assign name="l.settings:method:delivered" value="''" /> <mvt:assign name="l.settings:method:estimated:min" value="''" /> <mvt:assign name="l.settings:method:estimated:max" value="''" /> <mvt:while expr="ISNULL l.settings:method:delivered"> <mvt:assign name="l.settings:method:counter" value="l.settings:method:counter + 1" /> <mvt:assign name="l.settings:method:elapsed:days" value="l.settings:method:elapsed:days + 1" /> <mvt:assign name="l.settings:method:elapsed:duration" value="60 * 60 * 24 * l.settings:method:elapsed:days" /> <mvt:assign name="l.settings:method:elapsed:future_time" value="l.settings:day:time + l.settings:method:elapsed:duration"/> <mvt:assign name="l.settings:method:estimated:month" value="time_t_month( l.settings:method:elapsed:future_time, g.timezone_offset )" /> <mvt:assign name="l.settings:method:estimated:day" value="time_t_dayofmonth( l.settings:method:elapsed:future_time, g.timezone_offset )" /> <mvt:assign name="l.settings:method:estimated:dayofweek" value="time_t_dayofweek( l.settings:method:elapsed:future_time, g.timezone_offset )" /> <mvt:if expr="l.settings:method:estimated:dayofweek GT 1 AND l.settings:method:estimated:dayofweek LT 7"> <mvt:if expr="l.settings:method:processing:days EQ 0"> </mvt:if> <mvt:assign name="l.settings:method:processing:days" value="l.settings:method:processing:days + 1" /> </mvt:if> <mvt:if expr="l.settings:method:processing:days GT 1 AND l.settings:method:estimated:dayofweek GT 1"> <mvt:assign name="l.settings:method:shipping:days" value="l.settings:method:shipping:days + 1" /> </mvt:if> <mvt:if expr="ISNULL l.settings:method:estimated:min AND l.settings:method:shipping:days GE l.settings:method:delivery:min AND (l.settings:method:estimated:dayofweek GT 1 AND l.settings:method:estimated:dayofweek LT 7)"> <mvt:assign name="l.settings:method:estimated:min" value="l.settings:method:estimated:month $ '/' $ l.settings:method:estimated:day" /> <mvt:assign name="l.settings:method:estimated:min_day" value="l.settings:days[l.settings:method:estimated:dayofweek]:name" /> </mvt:if> <mvt:if expr="ISNULL l.settings:method:estimated:max AND l.settings:method:shipping:days GE l.settings:method:delivery:max AND (l.settings:method:estimated:dayofweek GT 1 AND l.settings:method:estimated:dayofweek LT 7)"> <mvt:assign name="l.settings:method:estimated:max" value="l.settings:method:estimated:month $ '/' $ l.settings:method:estimated:day" /> <mvt:assign name="l.settings:method:estimated:max_day" value="l.settings:days[l.settings:method:estimated:dayofweek]:name" /> <mvt:assign name="l.settings:method:delivered" value="1" /> </mvt:if> </mvt:while> </mvt:foreach> <mvt:foreach iterator="method" array="shippingmethods"> <p> <b>&mvt:method:name;</b><br> Estimated Delivery: &mvt:method:delivery:min;<mvt:if expr="l.settings:method:delivery:min NE l.settings:method:delivery:max">-&mvt:method:delivery:max;</mvt:if> business day(s)<br> Should Arrive: &mvt:method:estimated:min_day; &mvt:method:estimated:min;<mvt:if expr="l.settings:method:delivery:min NE l.settings:method:delivery:max"> to &mvt:method:estimated:max_day; &mvt:method:estimated:max;</mvt:if> </p> </mvt:foreach> <hr> </mvt:foreach>
 

Basket #11760

Get the formatted date one week from now.
Created: 1455057431
View "Basket #11760"
<mvt:eval expr="7 - 3" />
 

Basket #5690

 date  math
Get the formatted date one week from now.
Created: 1441916300
View "Basket #5690"
<mvt:assign name="l.settings:field:value" value="5434123465434536" /> <mvt:assign name="l.settings:field:firstfour" value="substring(l.settings:field:value, 1, 4 )" /> <mvt:assign name="l.settings:field:secondfour" value="substring(l.settings:field:value, 5, 4 )" /> <mvt:assign name="l.settings:field:thirdfour" value="substring(l.settings:field:value, 9, 4 )" /> <mvt:assign name="l.settings:field:lastfour" value="substring(l.settings:field:value, 13, 4 )" /> &mvt:field:firstfour; - &mvt:field:secondfour; - &mvt:field:thirdfour; - &mvt:field:lastfour;
 
View "Estimated Shipping Delivery Dates"
<mvt:comment><!-- Days --></mvt:comment> <mvt:assign name="g.timezone_offset" value="'local'" /> <mvt:assign name="l.settings:days[1]:name" value="'Sunday'" /> <mvt:assign name="l.settings:days[1]:time" value="1431284400" /> <mvt:assign name="l.settings:days[2]:name" value="'Monday'" /> <mvt:assign name="l.settings:days[2]:time" value="1431370800" /> <mvt:assign name="l.settings:days[3]:name" value="'Tuesday'" /> <mvt:assign name="l.settings:days[3]:time" value="1431457200" /> <mvt:assign name="l.settings:days[4]:name" value="'Wednesday'" /> <mvt:assign name="l.settings:days[4]:time" value="1431543600" /> <mvt:assign name="l.settings:days[5]:name" value="'Thursday'" /> <mvt:assign name="l.settings:days[5]:time" value="1431630000" /> <mvt:assign name="l.settings:days[6]:name" value="'Friday'" /> <mvt:assign name="l.settings:days[6]:time" value="1431716400" /> <mvt:assign name="l.settings:days[7]:name" value="'Saturday'" /> <mvt:assign name="l.settings:days[7]:time" value="1431802800" /> <mvt:comment><!-- Shipping Methods --></mvt:comment> <mvt:assign name="l.settings:shippingmethods[1]:name" value="'Next Day'" /> <mvt:assign name="l.settings:shippingmethods[1]:delivery:min" value="1" /> <mvt:assign name="l.settings:shippingmethods[1]:delivery:max" value="1" /> <mvt:assign name="l.settings:shippingmethods[2]:name" value="'2nd Day'" /> <mvt:assign name="l.settings:shippingmethods[2]:delivery:min" value="2" /> <mvt:assign name="l.settings:shippingmethods[2]:delivery:max" value="2" /> <mvt:assign name="l.settings:shippingmethods[3]:name" value="'Ground'" /> <mvt:assign name="l.settings:shippingmethods[3]:delivery:min" value="7" /> <mvt:assign name="l.settings:shippingmethods[3]:delivery:max" value="10" /> <mvt:foreach iterator="day" array="days"> <mvt:assign name="l.settings:day:month" value="time_t_month( l.settings:day:time, g.timezone_offset )" /> <mvt:assign name="l.settings:day:day" value="time_t_dayofmonth( l.settings:day:time, g.timezone_offset )" /> <mvt:assign name="l.settings:day:formatted_date" value="l.settings:day:month $ '/' $ l.settings:day:day" /> <h2>Order Placed: &mvt:day:name; @ &mvt:day:formatted_date;</h2> <mvt:foreach iterator="method" array="shippingmethods"> <mvt:assign name="l.settings:method:elapsed:days" value="0" /> <mvt:assign name="l.settings:method:shipping:days" value="0" /> <mvt:assign name="l.settings:method:processing:days" value="0" /> <mvt:assign name="l.settings:method:delivered" value="''" /> <mvt:assign name="l.settings:method:estimated:min" value="''" /> <mvt:assign name="l.settings:method:estimated:max" value="''" /> <mvt:while expr="ISNULL l.settings:method:delivered"> <mvt:assign name="l.settings:method:counter" value="l.settings:method:counter + 1" /> <mvt:assign name="l.settings:method:elapsed:days" value="l.settings:method:elapsed:days + 1" /> <mvt:assign name="l.settings:method:elapsed:duration" value="60 * 60 * 24 * l.settings:method:elapsed:days" /> <mvt:assign name="l.settings:method:elapsed:future_time" value="l.settings:day:time + l.settings:method:elapsed:duration"/> <mvt:assign name="l.settings:method:estimated:month" value="time_t_month( l.settings:method:elapsed:future_time, g.timezone_offset )" /> <mvt:assign name="l.settings:method:estimated:day" value="time_t_dayofmonth( l.settings:method:elapsed:future_time, g.timezone_offset )" /> <mvt:assign name="l.settings:method:estimated:dayofweek" value="time_t_dayofweek( l.settings:method:elapsed:future_time, g.timezone_offset )" /> <mvt:if expr="l.settings:method:estimated:dayofweek GT 1 AND l.settings:method:estimated:dayofweek LT 7"> <mvt:if expr="l.settings:method:processing:days EQ 0"> </mvt:if> <mvt:assign name="l.settings:method:processing:days" value="l.settings:method:processing:days + 1" /> </mvt:if> <mvt:if expr="l.settings:method:processing:days GT 1 AND l.settings:method:estimated:dayofweek GT 1"> <mvt:assign name="l.settings:method:shipping:days" value="l.settings:method:shipping:days + 1" /> </mvt:if> <mvt:if expr="ISNULL l.settings:method:estimated:min AND l.settings:method:shipping:days GE l.settings:method:delivery:min AND (l.settings:method:estimated:dayofweek GT 1 AND l.settings:method:estimated:dayofweek LT 7)"> <mvt:assign name="l.settings:method:estimated:min" value="l.settings:method:estimated:month $ '/' $ l.settings:method:estimated:day" /> <mvt:assign name="l.settings:method:estimated:min_day" value="l.settings:days[l.settings:method:estimated:dayofweek]:name" /> </mvt:if> <mvt:if expr="ISNULL l.settings:method:estimated:max AND l.settings:method:shipping:days GE l.settings:method:delivery:max AND (l.settings:method:estimated:dayofweek GT 1 AND l.settings:method:estimated:dayofweek LT 7)"> <mvt:assign name="l.settings:method:estimated:max" value="l.settings:method:estimated:month $ '/' $ l.settings:method:estimated:day" /> <mvt:assign name="l.settings:method:estimated:max_day" value="l.settings:days[l.settings:method:estimated:dayofweek]:name" /> <mvt:assign name="l.settings:method:delivered" value="1" /> </mvt:if> </mvt:while> </mvt:foreach> <mvt:foreach iterator="method" array="shippingmethods"> <p> <b>&mvt:method:name;</b><br> Estimated Delivery: &mvt:method:delivery:min;<mvt:if expr="l.settings:method:delivery:min NE l.settings:method:delivery:max">-&mvt:method:delivery:max;</mvt:if> business day(s)<br> Should Arrive: &mvt:method:estimated:min_day; &mvt:method:estimated:min;<mvt:if expr="l.settings:method:delivery:min NE l.settings:method:delivery:max"> to &mvt:method:estimated:max_day; &mvt:method:estimated:max;</mvt:if> </p> </mvt:foreach> <hr> </mvt:foreach>
 
View "Estimated Shipping Delivery Dates"
<mvt:comment><!-- Days --></mvt:comment> <mvt:assign name="g.timezone_offset" value="'local'" /> <mvt:assign name="l.settings:days[1]:name" value="'Sunday'" /> <mvt:assign name="l.settings:days[1]:time" value="1431284400" /> <mvt:assign name="l.settings:days[2]:name" value="'Monday'" /> <mvt:assign name="l.settings:days[2]:time" value="1431370800" /> <mvt:assign name="l.settings:days[3]:name" value="'Tuesday'" /> <mvt:assign name="l.settings:days[3]:time" value="1431457200" /> <mvt:assign name="l.settings:days[4]:name" value="'Wednesday'" /> <mvt:assign name="l.settings:days[4]:time" value="1431543600" /> <mvt:assign name="l.settings:days[5]:name" value="'Thursday'" /> <mvt:assign name="l.settings:days[5]:time" value="1431630000" /> <mvt:assign name="l.settings:days[6]:name" value="'Friday'" /> <mvt:assign name="l.settings:days[6]:time" value="1431716400" /> <mvt:assign name="l.settings:days[7]:name" value="'Saturday'" /> <mvt:assign name="l.settings:days[7]:time" value="1431802800" /> <mvt:comment><!-- Shipping Methods --></mvt:comment> <mvt:assign name="l.settings:shippingmethods[1]:name" value="'Next Day'" /> <mvt:assign name="l.settings:shippingmethods[1]:delivery:min" value="1" /> <mvt:assign name="l.settings:shippingmethods[1]:delivery:max" value="1" /> <mvt:assign name="l.settings:shippingmethods[2]:name" value="'2nd Day'" /> <mvt:assign name="l.settings:shippingmethods[2]:delivery:min" value="2" /> <mvt:assign name="l.settings:shippingmethods[2]:delivery:max" value="2" /> <mvt:assign name="l.settings:shippingmethods[3]:name" value="'Ground'" /> <mvt:assign name="l.settings:shippingmethods[3]:delivery:min" value="7" /> <mvt:assign name="l.settings:shippingmethods[3]:delivery:max" value="10" /> <mvt:foreach iterator="day" array="days"> <mvt:assign name="l.settings:day:month" value="time_t_month( l.settings:day:time, g.timezone_offset )" /> <mvt:assign name="l.settings:day:day" value="time_t_dayofmonth( l.settings:day:time, g.timezone_offset )" /> <mvt:assign name="l.settings:day:formatted_date" value="l.settings:day:month $ '/' $ l.settings:day:day" /> <h2>Order Placed: &mvt:day:name; @ &mvt:day:formatted_date;</h2> <mvt:foreach iterator="method" array="shippingmethods"> <mvt:assign name="l.settings:method:elapsed:days" value="0" /> <mvt:assign name="l.settings:method:shipping:days" value="0" /> <mvt:assign name="l.settings:method:processing:days" value="0" /> <mvt:assign name="l.settings:method:delivered" value="''" /> <mvt:assign name="l.settings:method:estimated:min" value="''" /> <mvt:assign name="l.settings:method:estimated:max" value="''" /> <mvt:assign name="l.settings:method:counter" value="0" /> <mvt:comment> <!-- <br><br> <b>&mvt:method:name;</b><br> --> </mvt:comment> <mvt:while expr="ISNULL l.settings:method:delivered AND l.settings:method:counter LT 20"> <mvt:assign name="l.settings:method:counter" value="l.settings:method:counter + 1" /> <mvt:assign name="l.settings:method:elapsed:days" value="l.settings:method:elapsed:days + 1" /> <mvt:assign name="l.settings:method:elapsed:duration" value="60 * 60 * 24 * l.settings:method:elapsed:days" /> <mvt:assign name="l.settings:method:elapsed:future_time" value="l.settings:day:time + l.settings:method:elapsed:duration"/> <mvt:assign name="l.settings:method:estimated:month" value="time_t_month( l.settings:method:elapsed:future_time, g.timezone_offset )" /> <mvt:assign name="l.settings:method:estimated:day" value="time_t_dayofmonth( l.settings:method:elapsed:future_time, g.timezone_offset )" /> <mvt:assign name="l.settings:method:estimated:dayofweek" value="time_t_dayofweek( l.settings:method:elapsed:future_time, g.timezone_offset )" /> <mvt:if expr="l.settings:method:estimated:dayofweek GT 1 AND l.settings:method:estimated:dayofweek LT 7"> <mvt:if expr="l.settings:method:processing:days EQ 0"> <mvt:comment><!-- <mvt:eval expr="l.settings:days[l.settings:method:estimated:dayofweek]:name"/> Processing +1<br> --></mvt:comment> </mvt:if> <mvt:assign name="l.settings:method:processing:days" value="l.settings:method:processing:days + 1" /> </mvt:if> <mvt:if expr="l.settings:method:processing:days GT 1 AND l.settings:method:estimated:dayofweek GT 1"> <mvt:comment><!-- <mvt:eval expr="l.settings:days[l.settings:method:estimated:dayofweek]:name"/> Shipping +1<br> --></mvt:comment> <mvt:assign name="l.settings:method:shipping:days" value="l.settings:method:shipping:days + 1" /> </mvt:if> <mvt:if expr="ISNULL l.settings:method:estimated:min AND l.settings:method:shipping:days GE l.settings:method:delivery:min AND (l.settings:method:estimated:dayofweek GT 1 AND l.settings:method:estimated:dayofweek LT 7)"> <mvt:assign name="l.settings:method:estimated:min" value="l.settings:method:estimated:month $ '/' $ l.settings:method:estimated:day" /> <mvt:assign name="l.settings:method:estimated:min_day" value="l.settings:days[l.settings:method:estimated:dayofweek]:name" /> <mvt:comment><!-- Delivered (Min.): <mvt:eval expr="l.settings:days[l.settings:method:estimated:dayofweek]:name"/><br> --></mvt:comment> </mvt:if> <mvt:if expr="ISNULL l.settings:method:estimated:max AND l.settings:method:shipping:days GE l.settings:method:delivery:max AND (l.settings:method:estimated:dayofweek GT 1 AND l.settings:method:estimated:dayofweek LT 7)"> <mvt:assign name="l.settings:method:estimated:max" value="l.settings:method:estimated:month $ '/' $ l.settings:method:estimated:day" /> <mvt:assign name="l.settings:method:estimated:max_day" value="l.settings:days[l.settings:method:estimated:dayofweek]:name" /> <mvt:comment><!-- Delivered (Max.): <mvt:eval expr="l.settings:days[l.settings:method:estimated:dayofweek]:name"/><br> --></mvt:comment> <mvt:assign name="l.settings:method:delivered" value="1" /> </mvt:if> </mvt:while> </mvt:foreach> <mvt:foreach iterator="method" array="shippingmethods"> <p> <b>&mvt:method:name;</b><br> Estimated Delivery: &mvt:method:delivery:min;<mvt:if expr="l.settings:method:delivery:min NE l.settings:method:delivery:max">-&mvt:method:delivery:max;</mvt:if> business day(s)<br> Should Arrive: &mvt:method:estimated:min_day; &mvt:method:estimated:min;<mvt:if expr="l.settings:method:delivery:min NE l.settings:method:delivery:max"> to &mvt:method:estimated:max_day; &mvt:method:estimated:max;</mvt:if> </p> </mvt:foreach> <hr> </mvt:foreach>
 

Basket #818

 date  math
Get the formatted date one week from now.
Created: 1429208272
View "Basket #818"
<mvt:assign name="l.index" value="miva_array_insert( l.settings:messages, 'hello there 1', -1 )" /> <mvt:assign name="l.index" value="miva_array_insert( l.settings:messages, 'hello someone', -1 )" /> <mvt:assign name="l.index" value="miva_array_insert( l.settings:messages, 'hello someone', -1 )" /> <mvt:assign name="l.settings:index" value="miva_array_insert( l.settings:messages, 'hello someone', -1 )" /> <mvt:assign name="l.settings:messages[5]" value="'surprise'" /> <mvt:assign name="l.settings:messages[1]" value="'surprise'" /> &mvt:index;
 

Formatted Date Math

 date  math
Get the formatted date one week from now.
Created: 1429208230
View "Formatted Date Math"
<mvt:assign name="g.current_time" value="s.dyn_time_t" /> <mvt:comment><!-- <mvt:assign name="g.timezone_offset" value="'-4'" /> --></mvt:comment> <mvt:assign name="g.timezone_offset" value="'local'" /> <mvt:assign name="g.duration" value="60 * 60 * 24 * 7" /> <mvt:assign name="g.future_time" value="g.current_time + g.duration"/> <mvt:assign name="g.year" value="time_t_year( g.future_time, g.timezone_offset )" /> <mvt:assign name="g.month" value="padl(time_t_month( g.future_time, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.day" value="padl(time_t_dayofmonth( g.future_time, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.24hour" value="padl(time_t_hour( g.future_time, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.min" value="padl(time_t_min( g.future_time, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.sec" value="padl(time_t_sec( g.future_time, g.timezone_offset ), 2, 0)" /> <mvt:assign name="g.formatted_future_date" value="g.year $ '-' $ g.month $ '-' $ g.day $ ' ' $ g.24hour $ ':' $ g.min $ ':' $ g.sec" /> &mvt:global:formatted_future_date;
 

Bruce Golub - Phosphor Media

Shows today's date in US Format, set to PST Local time.
Created: 1427847114
View "Bruce Golub - Phosphor Media"
<mvt:assign name="g.pmToday" value="padl(s.dyn_tm_mon, 2,0)$'-'$padl(s.dyn_tm_mday, 2,0)$'-'$s.dyn_tm_year"/> <mvt:eval expr="g.pmToday"/><br /> <mvt:comment> Or Just</mvt:comment> <mvt:eval expr="padl(s.dyn_tm_mon, 2,0)$'-'$padl(s.dyn_tm_mday, 2,0)$'-'$s.dyn_tm_year"/><br />
 

Bruce Golub - Phosphor Media

Shows today's date in US Format, set to PST Local time.
Created: 1427847040
View "Bruce Golub - Phosphor Media"
<mvt:assign name="g.pmToday" value="padl(s.dyn_tm_mon, 2,7)$'-'$padl(s.dyn_tm_mday, 2,7)$'-'$s.dyn_tm_year"/> <mvt:eval expr="g.pmToday"/><br /> <mvt:eval expr="padl(s.dyn_tm_mon, 2,7)$'-'$padl(s.dyn_tm_mday, 2,7)$'-'$s.dyn_tm_year"/><br />
 

Bruce Golub - Phosphor Media

Shows today's date in US Format, set to PST Local time.
Created: 1427846517

Basket #559

Shows today's date in US Format, set to PST Local time.
Created: 1427846235
View "Basket #559"
<mvt:while expr="g.counter LT 10"> <mvt:assign name="g.counter" value="g.counter + 1" /> &mvte:global:counter;<br> </mvt:while>