Skip to content

Commit

Permalink
front: drop addDurationToDate() and subtractDurationFromDate()
Browse files Browse the repository at this point in the history
This is now unused.

Signed-off-by: Simon Ser <[email protected]>
  • Loading branch information
emersion committed Feb 18, 2025
1 parent 5fd89fd commit 09207de
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions front/src/utils/date.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import dayjs, { type ManipulateType } from 'dayjs';
import dayjs from 'dayjs';
import 'dayjs/locale/fr';
import customParseFormat from 'dayjs/plugin/customParseFormat';
import timezone from 'dayjs/plugin/timezone';
Expand Down Expand Up @@ -134,22 +134,6 @@ export function convertUTCDateToLocalDate(date: number) {
return Math.abs(timeDifferenceMinutes) * 60 + date;
}

export function addDurationToDate(
startTime: Date,
duration: number,
durationUnit: ManipulateType = 'second'
): Date {
return dayjs(startTime).add(duration, durationUnit).toDate();
}

export function subtractDurationFromDate(
startTime: Date,
duration: number,
durationUnit: ManipulateType = 'second'
): Date {
return dayjs(startTime).subtract(duration, durationUnit).toDate();
}

/**
* Serializes a Date object to a string format 'DD/MM HH:mm:ss' without the year.
* @param {Date} date - The Date object to be serialized.
Expand Down

0 comments on commit 09207de

Please sign in to comment.