require(["datetimepicker"], function(){ $(function(){ $(".datetimepicker").each(function(){ var option = { lang : "zh", step : "30", timepicker : ' . (!empty($withtime) ? "true" : "false") . ',closeOnDateSelect : true, format : "Y-m-d' . (!empty($withtime) ? ' H:i:s"' : '"') . '}; $(this).datetimepicker(option); }); }); }); '; define('TPL_INIT_DATA', true); } $withtime = empty($withtime) ? false : true; if (!empty($value)) { $value = strexists($value, '-') ? strtotime($value) : $value; } else { $value = TIMESTAMP; } $value = ($withtime ? date('Y-m-d H:i:s', $value) : date('Y-m-d', $value)); $html .= ''; return $html; } }