diff --git a/helpers/parse-date.js b/helpers/parse-date.js index f051c50..296453b 100644 --- a/helpers/parse-date.js +++ b/helpers/parse-date.js @@ -20,6 +20,17 @@ const getRelativeTime = function (d1, d2 = new Date()) { } +export function makeLastUpdatedFriendly ( lastUpdated ) { + + if ( !lastUpdated ) return null + + const options = { month: "long", day: "numeric", year: "numeric" } + const date = new Date( lastUpdated.raw ) + const americanDate = new Intl.DateTimeFormat("en-US", options).format(date) + + return americanDate +} + export default function (rawDate) { const date = new Date(rawDate) diff --git a/pages/app/_slug/index.vue b/pages/app/_slug/index.vue index 2760bad..790cb5b 100644 --- a/pages/app/_slug/index.vue +++ b/pages/app/_slug/index.vue @@ -59,7 +59,7 @@