1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-23 23:20:57 +01:00

fix bug with datetime

This commit is contained in:
Lorenzo Yario 2024-05-16 22:51:20 -07:00 committed by GitHub
parent 3d797c95ca
commit 605f198d8c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -167,8 +167,12 @@ function twig_push_filter($array, $value) {
} }
function twig_date_filter($date, $format) { function twig_date_filter($date, $format) {
$date = new DateTime($date, new DateTimeZone('UTC')); if (is_numeric($date)) {
return $date->format($format); $date = new DateTime("@$date", new DateTimeZone('UTC'));
} else {
$date = new DateTime($date, new DateTimeZone('UTC'));
}
return $date->format($format);
} }
function twig_hasPermission_filter($mod, $permission, $board = null) { function twig_hasPermission_filter($mod, $permission, $board = null) {