export const dateWithoutTimezone = (date: Date) => { const tzoffset = date.getTimezoneOffset() * 60000; //offset in milliseconds const withoutTimezone = new Date(date.valueOf() - tzoffset) .toISOString() .slice(0, -1); return withoutTimezone; }; export const getDigitsCount = (num: number): number => { if (num === 0) return 1; return Math.floor(Math.log10(Math.abs(num))) + 1; };