Skip to content

Commit 9fce59c

Browse files
authored
Merge pull request #42 from JulianDroog/bug/missing-javascript-function
Added validateDate() function
2 parents 054ade7 + 5220f3a commit 9fce59c

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
@@ -339,6 +339,12 @@ class Datatable
339339
});
340340
341341
dt.css(:tableCss);
342+
343+
function validateDate(text) {
344+
text = text.replaceAll("/","-");
345+
var re = /^(\d{4}(-)\d{2}(-)\d{2}|\d{2}(-)\d{2}(-)\d{4})$/;
346+
return re.test(text);
347+
}
342348
});
343349
DATATABLE_CONFIGURATION;
344350

0 commit comments

Comments
 (0)