fix regex issue not matching correctly

This commit is contained in:
Corban-Lee Jones 2024-09-29 23:46:06 +01:00
parent 5d92cd4f7f
commit 08037d7846

View File

@ -30,7 +30,7 @@ function genHexString(len=6) {
// region DateTime
function isISODateTimeString(value) {
const isoDatePattern = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+([+-]\d{2}:\d{2}|Z)$/;
const isoDatePattern = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?([+-]\d{2}:\d{2}|Z)$/;
return typeof value === 'string' && isoDatePattern.test(value);
}