Skip to content

Commit

Permalink
Merge pull request #2123 from statisticsnorway/date-fns-default
Browse files Browse the repository at this point in the history
Use dateFns as default for format
  • Loading branch information
omsaggau authored Oct 5, 2023
2 parents 8ac2529 + 877ad0e commit 90920ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/resources/lib/ssb/utils/dateUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ export function formatDate(date: string | undefined, formatType: string, languag
// Track errors in logs
if (dateFnsResult && dateFnsResult !== libTimeResult) {
log.error(
`Error in formatDate, got different result with date-fns and lib-time when formatting ${parsedDate} to ${formatType}. date-fns: ${dateFnsResult}, lib-time: ${libTimeResult}`
`Error in formatDate, got different result with date-fns and lib-time when formatting (${date} - ${parsedDate}) to ${formatType}. date-fns: ${dateFnsResult}, lib-time: ${libTimeResult}`
)
}

return libTimeResult
return dateFnsResult || libTimeResult
}
return
}
Expand Down

0 comments on commit 90920ad

Please sign in to comment.