From 6f0972f779daf4d347ebd6cb85993195cced52dc Mon Sep 17 00:00:00 2001 From: Tiago Celestino <190265+tcelestino@users.noreply.github.com> Date: Mon, 21 Oct 2024 18:42:52 -0300 Subject: [PATCH] Adjusting date format (#50) --- .eleventy.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.eleventy.js b/.eleventy.js index 3b27d4d..7927572 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,13 +1,15 @@ -const { DateTime } = require('luxon'); const syntaxHighlight = require('@11ty/eleventy-plugin-syntaxhighlight'); module.exports = (eleventyConfig) => { eleventyConfig.addPassthroughCopy('assets'); eleventyConfig.addFilter('readableDate', (dateObj) => { - return DateTime.fromJSDate(dateObj) - .setLocale('pt') - .toFormat('d LLLL yyyy') - .toUpperCase(); + const date = new Date(dateObj); + date.setMinutes(date.getMinutes() + date.getTimezoneOffset()); + return date.toLocaleString('pt-BR', { + day: 'numeric', + month: 'long', + year: 'numeric', + }); }); eleventyConfig.addPlugin(syntaxHighlight); return {