Skip to content

Commit 1eb0bee

Browse files
authored
Merge pull request #38 from VictorOcio/feature/validateDate
feaure/validateDate add function lost up
2 parents 23774ba + 0aedd69 commit 1eb0bee

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

0 commit comments

Comments
 (0)