fix: add null check for date parameter in time utility to prevent errors

This commit is contained in:
faisolavolut 2025-03-14 12:33:55 +07:00
parent 10c2379a34
commit e6bd6ec210
1 changed files with 1 additions and 0 deletions

View File

@ -61,6 +61,7 @@ export const formatTime = (date: string | Date) => {
};
export const time = (date: string | Date) => {
if (!date) return null;
if (date === "string") {
const timeFormatRegex = /^(\d{2}):(\d{2})$/;
if (timeFormatRegex.test(date)) {