fix type error
parent
dae16fa6e9
commit
554b85a600
|
@ -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);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue