mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 08:55:54 +00:00
add function getConvertDateFormat()
This commit is contained in:
parent
2cc6ca95e9
commit
b9ad6e250f
|
@ -26,6 +26,21 @@ function formatted_size($size_bytes) { /* {{{ */
|
||||||
return number_format($size_bytes,0,"","")." 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) { /* {{{ */
|
function getReadableDate($timestamp) { /* {{{ */
|
||||||
global $settings;
|
global $settings;
|
||||||
if(!is_numeric($timestamp))
|
if(!is_numeric($timestamp))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user