From 51721cce78cf9e6b4034bc761e44260e800787c6 Mon Sep 17 00:00:00 2001 From: angeloneves19 Date: Wed, 14 Feb 2024 11:55:45 -0300 Subject: [PATCH] Refactor(src/helpers/format-data/index.js/therapies-description/index.js): ajustes do pr finalizado -@angeloneves19 -@thayanneregoo --- src/helpers/format-data/index.js | 3 ++- src/pages/therapies-description/index.js | 14 +------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/helpers/format-data/index.js b/src/helpers/format-data/index.js index 160c28a..b84c52b 100644 --- a/src/helpers/format-data/index.js +++ b/src/helpers/format-data/index.js @@ -1,11 +1,12 @@ const formatDate = (date) => { - return new Intl.DateTimeFormat('pt-BR', { + const dateFormated = new Intl.DateTimeFormat('pt-BR', { timeZone: 'UTC', day: '2-digit', month: 'short', year: 'numeric', weekday: 'long', }).format(date) + return dateFormated[0].toUpperCase()+ dateFormated.slice(1,) } export const formatWorkshopDuration = (workshop) => diff --git a/src/pages/therapies-description/index.js b/src/pages/therapies-description/index.js index fb83dca..e5c4392 100644 --- a/src/pages/therapies-description/index.js +++ b/src/pages/therapies-description/index.js @@ -18,6 +18,7 @@ import 'swiper/css/navigation' import 'swiper/css/thumbs' import NavBar from '../../components/navbar' import { Link, useParams } from 'react-router-dom' +import { formatWorkshopDates, formatWorkshopDuration } from '../../helpers/format-data' import ReactMarkdown from 'react-markdown' import rehypeRaw from 'rehype-raw' @@ -45,19 +46,6 @@ export const DetailsTherapies = () => { }) }, []) - const handleDate = (date) => { - const day = date.toLocaleDateString(undefined, { - day: 'numeric', - Timezone: 'UTF' - }) - const month = date.toLocaleDateString('pt-BR', { month: 'short' }) - const year = date.toLocaleDateString(undefined, { - year: 'numeric', - Timezone: 'UTF' - }) - return [day, month, year].join(' ') - } - return ( <>