Display local date format in date picker
This commit is contained in:
@@ -93,6 +93,39 @@ class AppHelper extends Base
|
||||
return $this->languageModel->getJsLanguageCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get date format for Jquery DatePicker
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getJsDateFormat()
|
||||
{
|
||||
$format = $this->dateParser->getUserDateFormat();
|
||||
$format = str_replace('m', 'mm', $format);
|
||||
$format = str_replace('Y', 'yy', $format);
|
||||
$format = str_replace('d', 'dd', $format);
|
||||
|
||||
return $format;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get time format for Jquery Plugin DateTimePicker
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getJsTimeFormat()
|
||||
{
|
||||
$format = $this->dateParser->getUserTimeFormat();
|
||||
$format = str_replace('H', 'HH', $format);
|
||||
$format = str_replace('i', 'mm', $format);
|
||||
$format = str_replace('g', 'h', $format);
|
||||
$format = str_replace('a', 'tt', $format);
|
||||
|
||||
return $format;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current timezone
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user