Hi guys,
I’ve been looking over these forums and from what I can tell I’m following the right syntax for setDate but every time I create a widget and try to set the date it always defaults to today. Would you mind taking a look at my code and seeing if I’m doing something wrong? I’m creating several calender widgets depending on if the database name is ‘date’ or ‘time’ and then creating a unique name for that widget based on the counter. Thanks much any help you can provide!
if ( strstr($temp_name1, "date") || strstr($temp_name1, "time") || $temp_name1=="DOB")
{
$datesql="SELECT DATE_FORMAT($temp_name1, '%Y, %m, %d, %H, %i, %s, 0') setdate from $source_table where lm_info_id = $lm_info_id";
$dateresults=mysql_query($datesql);
$daterow=mysql_fetch_assoc($dateresults);
$setrow=$daterow['setdate'];
print '<td style="width: 100px;'.$offset.'">';
print'<div id=\'content'.$counter.'\' style="height:0px; width:0px; padding-top: 0px;padding-right: 0px; padding-bottom: 0px;padding-left: 0px; margin-right:0; margin-left: 0; margin-top: 0;" >
<script type="text/javascript">
$(document).ready(function () {
// Create a jqxDateTimeInput
$("#jqxWidget'.$counter.'").jqxDateTimeInput({ width: \'300px\', height: \'25px\', formatString: \'F\' });
});
$(\'#jqxWidget'.$counter.'\').jqxDateTimeInput(\'setDate\', new Date ('.$setrow.'));
</script>
<div id=\'jqxWidget'.$counter.'\'>
</div>
</div>';
print '</td>';
}