diff --git a/inc/config.php b/inc/config.php index 0cece593..dae61ce6 100644 --- a/inc/config.php +++ b/inc/config.php @@ -976,11 +976,11 @@ // Timezone to use for displaying dates/times. $config['timezone'] = 'America/Los_Angeles'; - // The format string passed to strftime() for displaying dates. - // http://www.php.net/manual/en/function.strftime.php - $config['post_date'] = '%m/%d/%y (%a) %H:%M:%S'; + // The format string passed to date_format() for displaying dates. ISO 8601-like by default. + // https://www.php.net/manual/en/datetime.format.php + $config['post_date'] = 'd-m-Y (D) H:i:s'; // Same as above, but used for "you are banned' pages. - $config['ban_date'] = '%A %e %B, %Y'; + $config['ban_date'] = 'l j F, Y'; // The names on the post buttons. (On most imageboards, these are both just "Post"). $config['button_newtopic'] = _('New Topic'); diff --git a/inc/template.php b/inc/template.php index fb75aaf6..12d398d7 100644 --- a/inc/template.php +++ b/inc/template.php @@ -113,7 +113,6 @@ class Tinyboard extends Twig\Extension\AbstractExtension return array( new Twig\TwigFunction('time', 'time'), new Twig\TwigFunction('floor', 'floor'), - new Twig\TwigFunction('timezone', 'twig_timezone_function'), new Twig\TwigFunction('hiddenInputs', 'hiddenInputs'), new Twig\TwigFunction('hiddenInputsHash', 'hiddenInputsHash'), new Twig\TwigFunction('ratio', 'twig_ratio_function'), @@ -134,17 +133,14 @@ class Tinyboard extends Twig\Extension\AbstractExtension } } -function twig_timezone_function() { - return 'Z'; -} - function twig_push_filter($array, $value) { array_push($array, $value); return $array; } function twig_date_filter($date, $format) { - return gmstrftime($format, $date); + $date = new DateTime($date, new DateTimeZone('UTC')); + return $date->format($format); } function twig_hasPermission_filter($mod, $permission, $board = null) { diff --git a/templates/post/time.html b/templates/post/time.html index e6273f94..518a34b6 100644 --- a/templates/post/time.html +++ b/templates/post/time.html @@ -1 +1 @@ - + diff --git a/templates/themes/basic/index.html b/templates/themes/basic/index.html index 98cd0e39..02bc4387 100644 --- a/templates/themes/basic/index.html +++ b/templates/themes/basic/index.html @@ -29,7 +29,7 @@ {% else %} no subject {% endif %} - — by {{ entry.name }} at {{ entry.time|date(config.post_date, config.timezone) }} + — by {{ entry.name }} at {{ entry.time|date(config.post_date) }}

{{ entry.body }}

{% endfor %} diff --git a/templates/themes/catalog/catalog.html b/templates/themes/catalog/catalog.html index de7d1461..fefaec54 100644 --- a/templates/themes/catalog/catalog.html +++ b/templates/themes/catalog/catalog.html @@ -51,7 +51,7 @@ {% else %} + id="img-{{ post.id }}" data-subject="{% if post.subject %}{{ post.subject|e }}{% endif %}" data-name="{{ post.name|e }}" data-muhdifference="{{ post.muhdifference }}" class="{{post.board}} thread-image" title="{{post.bump|date('M d H:i')}}">
R: {{ post.reply_count }} / I: {{ post.image_count }}{% if post.sticky %} (sticky){% endif %} diff --git a/templates/themes/sitemap/sitemap.xml b/templates/themes/sitemap/sitemap.xml index 30033239..8c4a9fa2 100644 --- a/templates/themes/sitemap/sitemap.xml +++ b/templates/themes/sitemap/sitemap.xml @@ -10,7 +10,7 @@ {% for thread in thread_list %} {{ settings.url ~ (config.board_path | format(board)) ~ config.dir.res ~ link_for(thread) }} - {{ thread.lastmod | date('%Y-%m-%dT%H:%M:%S') }}{{ timezone() }} + {{ thread.lastmod | date('Y-m-d\\TH:i:s\Z') }} {{ settings.changefreq }} {% endfor %}