Skip to content

Commit

Permalink
Add a deprecation warning to the format function in date.js, recommen…
Browse files Browse the repository at this point in the history
…ding the use of formatDate instead
  • Loading branch information
paulgain committed Dec 18, 2024
1 parent 9c33a32 commit 0521a01
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/client/utils/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,18 @@ function isShortDateValid(year, month) {
}

/**
* Date formatting and parsing functions
* @deprecated This function is deprecated. Use `formatDate` instead.
*
* This function will be removed in the near future.
*/

function format(dateStr, dateFormat = DATE_LONG_FORMAT_2) {
return isDateValid(dateStr) ? formatFns(parseISO(dateStr), dateFormat) : null
}

/**
* Parsing functions
*/

const padZero = (value) => {
const parsedValue = parseInt(value, 10)
if (Number.isNaN(parsedValue)) {
Expand Down

0 comments on commit 0521a01

Please sign in to comment.