From 0521a010d8338f623c9edaad348bbd67b1a1d4d0 Mon Sep 17 00:00:00 2001 From: Paul Gain Date: Tue, 17 Dec 2024 11:30:28 +0000 Subject: [PATCH] Add a deprecation warning to the format function in date.js, recommending the use of formatDate instead --- src/client/utils/date.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/client/utils/date.js b/src/client/utils/date.js index 58ab504418..69fed4dda3 100644 --- a/src/client/utils/date.js +++ b/src/client/utils/date.js @@ -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)) {