Accounting for date precision in scene and movie pages and tiles.

This commit is contained in:
DebaucheryLibrarian 2024-08-19 23:31:28 +02:00
parent 0cc9ee51e2
commit 1ea8e52ab1
6 changed files with 27 additions and 5 deletions

View File

@ -65,7 +65,11 @@
:datetime="movie.effectiveDate.toISOString()"
class="date"
:class="{ nodate: !movie.date }"
>{{ format(movie.effectiveDate, movie.effectiveDate.getFullYear() === currentYear ? 'MMM d' : 'MMM d, y') }}</time>
>{{ format(movie.effectiveDate, {
day: movie.effectiveDate.getFullYear() === currentYear ? 'MMM d' : 'MMM d, y',
month: movie.effectiveDate.getFullYear() === currentYear ? 'MMM' : 'MMM y',
year: 'y',
}[movie.datePrecision]) }}</time>
</div>
<a

View File

@ -75,7 +75,11 @@
:datetime="scene.effectiveDate.toISOString()"
class="date"
:class="{ nodate: !scene.date }"
>{{ format(scene.effectiveDate, 'MMM d, y') }}</time>
>{{ format(scene.effectiveDate, {
day: 'MMM d, y',
month: 'MMM y',
year: 'y',
}[scene.datePrecision]) }}</time>
</Link>
</div>

View File

@ -90,7 +90,11 @@
<time
:datetime="movie.effectiveDate.toISOString()"
class="date ellipsis"
>{{ formatDate(movie.effectiveDate, 'MMMM d, y') }}</time>
>{{ formatDate(movie.effectiveDate, {
day: 'MMMM d, y',
month: 'MMMM y',
year: 'y',
}[movie.datePrecision]) }}</time>
</div>
<div class="header">

View File

@ -109,12 +109,20 @@
<time
:datetime="scene.effectiveDate.toISOString()"
class="ellipsis compact-hide"
>{{ formatDate(scene.effectiveDate, 'MMMM d, y') }}</time>
>{{ formatDate(scene.effectiveDate, {
day: 'MMMM d, y',
month: 'MMMM y',
year: 'y',
}[scene.datePrecision]) }}</time>
<time
:datetime="scene.effectiveDate.toISOString()"
class="ellipsis compact-show"
>{{ formatDate(scene.effectiveDate, 'MMM d, y') }}</time>
>{{ formatDate(scene.effectiveDate, {
day: 'MMM d, y',
month: 'MMM y',
year: 'y',
}[scene.datePrecision]) }}</time>
</Link>
</div>

View File

@ -22,6 +22,7 @@ function curateMovie(rawMovie, assets) {
slug: rawMovie.slug,
url: rawMovie.url,
date: rawMovie.date,
datePrecision: rawMovie.date_precision,
createdAt: rawMovie.created_at,
effectiveDate: rawMovie.effective_date,
description: rawMovie.description,

View File

@ -58,6 +58,7 @@ function curateScene(rawScene, assets) {
slug: rawScene.slug,
url: rawScene.url,
date: rawScene.date,
datePrecision: rawScene.date_precision,
createdAt: rawScene.created_at,
effectiveDate: rawScene.effective_date,
description: rawScene.description,