Skip to content

Commit 0aedd69

Browse files
author
Victor Ocio
committed
feaure/validateDate add function lost up
1 parent 154ceea commit 0aedd69

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Datatable/Datatable.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,12 @@ class Datatable
325325
});
326326
});
327327
}
328+
329+
function validateDate(text) {
330+
text = text.replaceAll("/","-");
331+
var re = /^(\d{4}(-)\d{2}(-)\d{2}|\d{2}(-)\d{2}(-)\d{4})$/;
332+
return re.test(text);
333+
}
328334
});
329335
DATATABLE_CONFIGURATION;
330336

0 commit comments

Comments
 (0)