feat(app/utils, plugins): normalize dates with improved format (#573)

This commit is contained in:
Simon Lecoq
2021-10-13 22:08:31 -04:00
committed by GitHub
parent 19036b2e41
commit 662fe8de2f
16 changed files with 32 additions and 16 deletions

View File

@@ -69,7 +69,7 @@ export default async function({login, imports, data, q, account}, {enabled = fal
//Format text
console.debug(`metrics/compute/${login}/plugins > tweets > formatting tweet ${tweet.id}`)
tweet.createdAt = `${imports.format.date(tweet.created_at, {timeStyle:"short"})} on ${imports.format.date(tweet.created_at, {dateStyle:"short"})}`
tweet.createdAt = `${imports.format.date(tweet.created_at, {time:true})} on ${imports.format.date(tweet.created_at, {date:true})}`
tweet.text = imports.htmlescape(
//Escape tags
imports.htmlescape(tweet.text, {"<":true, ">":true})