Upcoming shows: [!Ditto? &startID=`63` &filter=tvShowTime,[[mytimesnip]],6 &sortBy=`ShowTime` &sortDir=`ASC` &summarize=`5` &total=`5`&tpl=`showsummary` &paginateAlwaysShowLinks=`1`!] Shows in the past: [!Ditto? &startID=`63` &filter=tvShowTime,[[mytimesnip]],5 &sortDir=`ASC` &summarize=`5` &total=`5`&tpl=`showsummary`!]
[!NewsEditor? &folder=`63` &clearcache=`1` &formtpl=`Showtimetpl`!]
<form name="NewsEditor" method="post" action="[~[*id*]~]">
<input name="NewsEditorForm" type="hidden" value="on" />
<input name="editid" type="hidden" value="[+editid+]" />
Page title:<br /><input name="pagetitle" type="text" size="40" value="[+pagetitle+]" /><br />
<p>Enter place for show <br />
<input name="longtitle" type="text" size="40" value="[+longtitle+]" /></p>
<p>More info about show <br />
<input name="content" type="text" size="40" value="[+content+]" /></p>
<p>Date for show (Select opens date selection tool) <br />
<input name="tvShowTime">
<input type=button value="select" onclick="displayDatePicker('tvShowTime', false, 'dmy', '-');">
<br />
<input name="send" type="submit" value="Submit" />
</form>
<form name="NewsEditor" method="post" action="[~[*id*]~]">
<input name="NewsEditorForm" type="hidden" value="on" />
<input name="editid" type="hidden" value="[+editid+]" />
Page title:<br /><input name="pagetitle" type="text" size="40" value="[+pagetitle+]" /><br />
<p>Enter place for show <br />
<input name="longtitle" type="text" size="40" value="[+longtitle+]" /></p>
<p>More info about show <br />
<input name="content" type="text" size="40" value="[+content+]" /></p>
<p>Date for show (Select opens date selection tool) <br />
<script type="text/javascript" src="/datepicker/DatePicker.js"></script>
<script type="text/javascript">
// The following should be put in your external js file,
// with the rest of your ondomready actions.
window.addEvent('domready', function(){
$$('input.DatePicker').each( function(el){
new DatePicker(el);
});
});
</script>
<p>
<label for="birthday">default calendar</label>
<input id="tvShowTime" name="tvShowTime" type="text" class="DatePicker" tabindex="1" value="10/24/2016" />
</p>
<br />
<input name="send" type="submit" value="Submit" />
</form>08/01/2009
<form name="NewsEditor" method="post" action="[~[*id*]~]">
<input name="NewsEditorForm" type="hidden" value="on" />
<input name="editid" type="hidden" value="[+editid+]" />
Page title:<br /><input name="pagetitle" type="text" size="40" value="[+pagetitle+]" /><br />
<p>Enter place for show <br />
<input name="longtitle" type="text" size="40" value="[+longtitle+]" /></p>
<p>More info about show <br />
<input name="content" type="text" size="40" value="[+content+]" /></p>
<p>Date for show (Select opens date selection tool) <br />
<script type="text/javascript" src="/datepicker/DatePicker.js"></script>
<script type="text/javascript">
// The following should be put in your external js file,
// with the rest of your ondomready actions.
window.addEvent('domready', function(){
$$('input.DatePicker').each( function(el){
new DatePicker(el);
});
});
</script>
<p>
<label for="birthday">default calendar</label>
<input id="tvShowTime" name="tvShowTime" type="text" class="DatePicker" tabindex="1" value="10/24/2016" alt="{format:'mm-dd-yyyy'}" />
</p>
<P><INPUT TYPE=text NAME="tvShow" SIZE=8 MAXLENGTH=8></P>
<br />
<input name="send" type="submit" value="Submit" />
</form>
Do you mean that I just need to have my date picker using MySQL date format (YYYY-MM-DD HH:MM:SS) and then unixtime widget in TV handles that variable is oputputted as unix time stamp? Actually datepicker inside ModX manager uses that format and tvShowTime is saved correctly.
The datepicker that MODx uses puts out exactly what you see in the text field after selecting a date from the javascript widget.
The Publish and Unpublish dates are converted to a Unix timestamp before being inserted into the database.
However, a Date-type TV is simply stored as a string in the form the datepicker puts out. It usually needs to be converted to a UNIX timestamp before it can be used in a snippet. The TV "Unixtime" output widget uses the mktime function if it’s a standard MySQL date format, and strtotime otherwise.
http://il.php.net/mktime
http://il.php.net/strtotime
<input class="plugin-datetimepicker-field-3" id="tvShowTime" name="tvShowTime" value="" onblur="documentDirty=true;" type="hidden"> <table width="250" border="0" cellpadding="0" cellspacing="0"> <tbody><tr> <td style="border: 1px solid rgb(128, 128, 128);" width="160"><span id="tvShowTime_show" class="plugin-datetimepicker-show-3"> (not set)</span> </td> <td> <a class="plugin-datetimepicker-trigger-3" onmouseover="window.status='Select a date'; return true;" onmouseout="window.status=''; return true;" style="cursor: pointer;"><img src="media/style/MODxLight//images/icons/cal.gif" width="16" border="0" height="16"></a> <a onclick="document.forms['mutate'].elements['tvShowTime'].value='';document.forms['mutate'].elements['tvShowTime'].onblur();document.getElementById('tvShowTime_show').innerHTML='(not set)'; return true;" onmouseover="window.status='clear the date'; return true;" onmouseout="window.status=''; return true;" style="cursor: pointer;"><img src="media/style/MODxLight//images/icons/cal_nodate.gif" alt="No date" width="16" border="0" height="16"></a> </td> </tr> </tbody></table><script type="text/javascript"> var calShowTime = new calendar1(document.forms['mutate'].elements['tvShowTime'], document.getElementById("tvShowTime_show")); calShowTime.path="http://www.insaneaffection.com/manager/media/"; calShowTime.year_scroll = true; calShowTime.time_comp = true;</script><span class="warning">Show</span> <br><span class="comment"></span></td> <td style="position: relative;" valign="top"> <input id="tvShow" name="tvShow" value="" tvtype="text" onchange="documentDirty=true;" style="width: 300px;" type="text">