1. Add time format in inc/js/jquery.webForms.js file:
$(this).datetimepicker({ changeYear: true, changeMonth: true, timeFormat: 'hh:mm tt', dateFormat: 'yy-mm-dd' });
2. Modify these three functions in inc/classes/BxDolForm.php file:
function checkDateTime ($s) { // remove unnecessary opera's input value; $s = str_replace('T', ' ', $s); $s = str_replace('Z', ':00', $s); return $this->checkPreg ($s, '#^\d+\-\d+\-\d+[\sT]{1}\d+:\d+\s[AMPamp]{2}$#'); }
function _passDateTime ($s) { if (preg_match('#(\d+)\-(\d+)\-(\d+)[\sT]{1}(\d+):(\d+)(\s|)(am|pm|AM|PM|)#', $s, $m)) { $iDay = $m[3]; $iMonth = $m[2]; $iYear = $m[1]; $iH = $m[4]; $iM = $m[5]; if (isset($m[7]) && $m[7]) { $iH = date("H", strtotime("{$m[4]}:{$m[5]} {$m[7]}")); $iM = date("i", strtotime("{$m[4]}:{$m[5]} {$m[7]}")); } $iRet = mktime ($iH, $iM, 0, $iMonth, $iDay, $iYear); return $iRet > 0 ? $iRet : 0; } return $this->passDate ($s); }
function displayDateTime ($i) { return date("Y-m-d h:i a", $i); }