diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-06-05 22:22:10 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-06-05 22:22:10 -0400 |
commit | 9cb8a1ffc9ed1e74411fe399cfd5dcf59c071293 (patch) | |
tree | edace4de1bf78e715b119d19986fbab592cb191d /app/Helper | |
parent | 656f4306325d7944280ce111d95aeaeacab8d3cd (diff) |
Display local date format in date picker
Diffstat (limited to 'app/Helper')
-rw-r--r-- | app/Helper/AppHelper.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/app/Helper/AppHelper.php b/app/Helper/AppHelper.php index b738f85c..09f280cb 100644 --- a/app/Helper/AppHelper.php +++ b/app/Helper/AppHelper.php @@ -94,6 +94,39 @@ class AppHelper extends Base } /** + * 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 * * @access public |