diff --git a/components/movies/tile.vue b/components/movies/tile.vue index 84e73f1..7d61a83 100644 --- a/components/movies/tile.vue +++ b/components/movies/tile.vue @@ -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') }} + >{{ 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]) }} {{ format(scene.effectiveDate, 'MMM d, y') }} + >{{ format(scene.effectiveDate, { + day: 'MMM d, y', + month: 'MMM y', + year: 'y', + }[scene.datePrecision]) }} diff --git a/pages/movies/@movieId/+Page.vue b/pages/movies/@movieId/+Page.vue index 1e6fca3..d2a2685 100644 --- a/pages/movies/@movieId/+Page.vue +++ b/pages/movies/@movieId/+Page.vue @@ -90,7 +90,11 @@ + >{{ formatDate(movie.effectiveDate, { + day: 'MMMM d, y', + month: 'MMMM y', + year: 'y', + }[movie.datePrecision]) }}
diff --git a/pages/scene/+Page.vue b/pages/scene/+Page.vue index 89e8f66..cab84d2 100644 --- a/pages/scene/+Page.vue +++ b/pages/scene/+Page.vue @@ -109,12 +109,20 @@ + >{{ formatDate(scene.effectiveDate, { + day: 'MMMM d, y', + month: 'MMMM y', + year: 'y', + }[scene.datePrecision]) }} + >{{ formatDate(scene.effectiveDate, { + day: 'MMM d, y', + month: 'MMM y', + year: 'y', + }[scene.datePrecision]) }}
diff --git a/src/movies.js b/src/movies.js index 0736c31..dc16a5c 100644 --- a/src/movies.js +++ b/src/movies.js @@ -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, diff --git a/src/scenes.js b/src/scenes.js index 7907e7f..221d924 100644 --- a/src/scenes.js +++ b/src/scenes.js @@ -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,