Skip to content

Commit

Permalink
Merge pull request #39 from nginformatica/bugfix/tooltip
Browse files Browse the repository at this point in the history
fix(area-chart): add standard formatDate if undefined
  • Loading branch information
evandersondev authored Jul 21, 2023
2 parents 88b369c + 0c928e6 commit c77caf5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "amazing-react-charts",
"version": "0.7.7",
"version": "0.7.8",
"description": "An amazing react charts package based in echarts",
"license": "MIT",
"main": "dist/index.js",
Expand Down
9 changes: 4 additions & 5 deletions src/lib/auxiliarFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,10 @@ export const toDate = (text: string, format?: string) =>
export const formatTime = (text: string, dateFormat = 'dd MMM') =>
format(new Date(text), dateFormat, { locale: ptBR })

export const formatTooltip = (text: string, dateFormat?: string) =>
format(
new Date(text), getDateFormatType(dateFormat, 'dd/MM/yyyy'), {
locale: ptBR
})
export const formatTooltip = (text: string, dateFormat = 'dd MMM') => format(
new Date(text), getDateFormatType(dateFormat, 'dd/MM/yyyy'), {
locale: ptBR
})

export const formatTooltipWithHours = (text: string) =>
format(new Date(text), 'dd/MM/yyyy HH:mm', { locale: ptBR })
Expand Down

0 comments on commit c77caf5

Please sign in to comment.