fix type error

fix/booking-limits
CarinaWolli 2023-10-31 15:40:33 -04:00
parent dae16fa6e9
commit 554b85a600
1 changed files with 2 additions and 1 deletions

View File

@ -206,7 +206,8 @@ export const stringOrNumber = z.union([
]); ]);
export const stringToDayjs = z.string().transform((val) => { export const stringToDayjs = z.string().transform((val) => {
const timezone = val.match(/([+-]\d{2}:\d{2})$/)[1] || "+00:00"; const matches = val.match(/([+-]\d{2}:\d{2})$/)[1];
const timezone = matches ? matches[1] : "+00:00";
return dayjs(val).utcOffset(timezone); return dayjs(val).utcOffset(timezone);
}); });