function dateField($label, $name, $format = RAPYD_DATE_FORMAT) { $format = locale_to_format($format); parent::objField($label, $name); $this->format = $format; $this->extra_output = ''; //RAPYD_DATE_FORMAT; }
/** * convert PHP date format string to JScalendar date format string. * utility function to be used in jscalendar. * * @param string * @return string * @todo codes must be implemented in timestampFromInputDate() */ function datestamp_from_format($format = RAPYD_DATE_FORMAT) { $format = locale_to_format($format); //$phpCodes = array('d', 'm', 'M', 'Y', 'y', 'D', 'l', 'F', 'j', 'w'); //$jsCodes = array('%d', '%m', '%b', '%Y', '%y', '%a', '%A', '%B', '%e', '%w'); // reduced set without text representation of day and month; only numbers $phpCodes = array('d', 'm', 'n', 'Y', 'y', 'j', 'H', 'i', 's'); $jsCodes = array('%d', '%m', '%m', '%Y', '%y', '%e', '%H', '%M', '%S'); $jsDateFormat = str_replace($phpCodes, $jsCodes, $format); return $jsDateFormat; }