fix(movie/show.php.liquid): localize last watched dates to America/Los_Angeles

This commit is contained in:
Cory Dransfeldt 2025-04-26 20:48:47 -07:00
parent ea6d1c9284
commit 4958c7fe66
No known key found for this signature in database
4 changed files with 13 additions and 5 deletions

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "coryd.dev",
"version": "3.3.1",
"version": "3.3.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "coryd.dev",
"version": "3.3.1",
"version": "3.3.2",
"license": "MIT",
"dependencies": {
"html-minifier-terser": "7.2.0",

View file

@ -1,6 +1,6 @@
{
"name": "coryd.dev",
"version": "3.3.1",
"version": "3.3.2",
"description": "The source for my personal site. Built using 11ty (and other tools).",
"type": "module",
"engines": {

View file

@ -36,7 +36,11 @@ schema: movie
<span class="sub-meta tattoo">{% tablericon "needle" %} I have a tattoo inspired by this movie!</span>
<?php endif; ?>
<?php if (!empty($movie["last_watched"])): ?>
<span class="sub-meta">Last watched on <?= date('F j, Y', strtotime($movie["last_watched"])) ?>.</span>
<?php
$date = new DateTime($movie["last_watched"]);
$date->setTimezone(new DateTimeZone('America/Los_Angeles'));
?>
<span class="sub-meta">Last watched on <?= $date->format('F j, Y') ?>.</span>
<?php endif; ?>
</div>
<?php if (!empty($movie["review"])): ?>

View file

@ -33,7 +33,11 @@ schema: show
<span class="sub-meta tattoo">{% tablericon "needle" %} I have a tattoo inspired by this show!</span>
<?php endif; ?>
<?php if (!empty($show["episode"]["formatted_episode"])): ?>
<span class="sub-meta">I last watched&puncsp;<mark><?= htmlspecialchars($show["episode"]["formatted_episode"]) ?></mark>&puncsp;on <?= date('F j, Y', strtotime($show["episode"]["last_watched_at"])) ?>.</span>
<?php
$date = new DateTime($show["episode"]["last_watched_at"]);
$date->setTimezone(new DateTimeZone('America/Los_Angeles'));
?>
<span class="sub-meta">I last watched&nbsp;<mark><?= htmlspecialchars($show["episode"]["formatted_episode"]) ?></mark>&nbsp;on <?= $date->format('F j, Y') ?>.</span>
<?php endif; ?>
</div>
<?php if (!empty($show["review"])): ?>