From eee072225410ebf6c6ab4b7f7491618ba60f6ffd Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Sun, 16 Apr 2023 10:22:13 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20(date)=20time=20pass=20as=20minu?= =?UTF-8?q?tes=20even=20in=20dev=20env?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/shared/format-date.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/format-date.ts b/src/shared/format-date.ts index 4ad6eec..9c0aad3 100644 --- a/src/shared/format-date.ts +++ b/src/shared/format-date.ts @@ -1,6 +1,6 @@ import type { ISODate } from './types/date' -const isDevelopment = () => process.env.NODE_ENV === 'development' +// const isDevelopment = () => process.env.NODE_ENV === 'development' export const formatDate = (date: Date | string) => new Date(date).toLocaleString() @@ -17,5 +17,5 @@ export const formatLongDate = (date: Date | ISODate) => export const formatDiffInMinutes = (date1: ISODate, date2: ISODate) => { const diffInMs = new Date(date2).getTime() - new Date(date1).getTime() - return Math.max(0, Math.round(diffInMs / (1000 * (isDevelopment() ? 1 : 60)))) + return Math.max(0, Math.round(diffInMs / (1000 * 60))) }