From cee810e63537c059ef0ffd4bc4e2a1d104354281 Mon Sep 17 00:00:00 2001 From: tycrek Date: Thu, 15 Apr 2021 14:56:08 -0600 Subject: [PATCH] added timestamp formatting --- ogp.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ogp.js b/ogp.js index acd48b2..29703f2 100644 --- a/ogp.js +++ b/ogp.js @@ -1,4 +1,5 @@ const Mustache = require('mustache'); +const DateTime = require('luxon').DateTime; const github = require('./package.json').homepage; const { formatBytes } = require('./utils'); @@ -54,7 +55,7 @@ class OpenGraph { }) .replace(new RegExp('&size', 'g'), formatBytes(this.size)) .replace(new RegExp('&filename', 'g'), this.filename) - .replace(new RegExp('×tamp', 'g'), this.timestamp); + .replace(new RegExp('×tamp', 'g'), DateTime.fromMillis(this.timestamp).toLocaleString(DateTime.DATETIME_MED)); } }