Skip to content

Commit

Permalink
Refactor(src/helpers/format-data/index.js/therapies-description/index…
Browse files Browse the repository at this point in the history
….js): ajustes do pr finalizado -@angeloneves19 -@thayanneregoo
  • Loading branch information
angeloneves19 committed Feb 14, 2024
1 parent 7ba91c0 commit 51721cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
3 changes: 2 additions & 1 deletion src/helpers/format-data/index.js
Original file line number Diff line number Diff line change
@@ -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) =>
Expand Down
14 changes: 1 addition & 13 deletions src/pages/therapies-description/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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 (
<>
<NavBar/>
Expand Down

0 comments on commit 51721cc

Please sign in to comment.