From 1ed5a393b0d1f61fdca71219cd34bd40572e6624 Mon Sep 17 00:00:00 2001 From: rory Date: Fri, 3 May 2024 13:27:29 -0700 Subject: [PATCH] Remove unused code from DateUtils --- src/libs/DateUtils.ts | 43 ------------------------------------------- 1 file changed, 43 deletions(-) diff --git a/src/libs/DateUtils.ts b/src/libs/DateUtils.ts index 22c5a7d907cc..8bd37ddd698d 100644 --- a/src/libs/DateUtils.ts +++ b/src/libs/DateUtils.ts @@ -42,7 +42,6 @@ import * as Localize from './Localize'; import Log from './Log'; type CustomStatusTypes = (typeof CONST.CUSTOM_STATUS_TYPES)[keyof typeof CONST.CUSTOM_STATUS_TYPES]; -type TimePeriod = 'AM' | 'PM'; type Locale = ValueOf; type WeekDay = 0 | 1 | 2 | 3 | 4 | 5 | 6; @@ -398,19 +397,6 @@ function addMillisecondsFromDateTime(dateTime: string, milliseconds: number): st return getDBTime(newTimestamp); } -/** - * @param isoTimestamp example: 2023-05-16 05:34:14.388 - * @returns example: 2023-05-16 - */ -function getDateStringFromISOTimestamp(isoTimestamp: string): string { - if (!isoTimestamp) { - return ''; - } - - const [dateString] = isoTimestamp.split(' '); - return dateString; -} - /** * returns {string} example: 2023-05-16 05:34:14 */ @@ -631,28 +617,6 @@ function get12HourTimeObjectFromDate(dateTime: string): {hour: string; minute: s }; } -/** - * param {String} timeString - * returns {String} - * example getTimePeriod('11:10 PM') // 'PM' - */ -function getTimePeriod(timeString: string): TimePeriod { - const parts = timeString.split(' '); - return parts[1] as TimePeriod; -} - -/** - * param {String} dateTimeStringFirst // YYYY-MM-DD HH:mm:ss - * param {String} dateTimeStringSecond // YYYY-MM-DD HH:mm:ss - * returns {Boolean} - */ -function areDatesIdentical(dateTimeStringFirst: string, dateTimeStringSecond: string): boolean { - const date1 = parse(dateTimeStringFirst, 'yyyy-MM-dd HH:mm:ss', new Date()); - const date2 = parse(dateTimeStringSecond, 'yyyy-MM-dd HH:mm:ss', new Date()); - - return isSameSecond(date1, date2); -} - /** * Checks if the time input is at least one minute in the future. * param {String} timeString: '04:24 AM' @@ -782,19 +746,13 @@ const DateUtils = { setLocale, subtractMillisecondsFromDateTime, addMillisecondsFromDateTime, - getDateStringFromISOTimestamp, - getThirtyMinutesFromNow, getEndOfToday, - getOneWeekFromNow, getDateFromStatusType, getOneHourFromNow, extractDate, - formatDateTimeTo12Hour, getStatusUntilDate, extractTime12Hour, get12HourTimeObjectFromDate, - areDatesIdentical, - getTimePeriod, getLocalizedTimePeriodDescription, combineDateAndTime, getDayValidationErrorKey, @@ -805,7 +763,6 @@ const DateUtils = { getMonthNames, getDaysOfWeek, formatWithUTCTimeZone, - getWeekStartsOn, getWeekEndsOn, isTimeAtLeastOneMinuteInFuture, formatToSupportedTimezone,