diff --git a/inc/inc.Utils.php b/inc/inc.Utils.php index 49cef3443..0747c4abe 100644 --- a/inc/inc.Utils.php +++ b/inc/inc.Utils.php @@ -26,6 +26,21 @@ function formatted_size($size_bytes) { /* {{{ */ return number_format($size_bytes,0,"","")." Bytes"; } /* }}} */ +/* Date picker needs a different syntax for date formats using + * yyyy for %Y + * yy for %y + * mm for %m + * dd for %d + * This functions returns the converted format + */ +function getConvertDateFormat() { + global $settings; + if($settings->_dateformat) { + return str_replace(['y', 'Y', 'm', 'M', 'F', 'd', 'l', 'D'], ['yy', 'yyyy', 'mm', 'M', 'MM', 'dd', 'DD', 'D'], $settings->_dateformat); + } else + return 'yyyy-mm-dd'; +} + function getReadableDate($timestamp) { /* {{{ */ global $settings; if(!is_numeric($timestamp))