From 39a97fd5166be39ca0524bf87402a67882a3ddd4 Mon Sep 17 00:00:00 2001 From: Kasun Chathuranga Date: Mon, 5 Aug 2013 17:27:57 +0530 Subject: [PATCH] Modify isTime() function to accept times with fractional --- js/tbl_change.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/tbl_change.js b/js/tbl_change.js index ef73dacd38..1e25bb8129 100644 --- a/js/tbl_change.js +++ b/js/tbl_change.js @@ -132,6 +132,7 @@ function isDate(val, tmstmp) * The following patterns are accepted in this validation (accepted in mysql as well) * 1) 2:3:4 * 2) 2:23:43 +* 3) 2:23:43.123456 */ function isTime(val) { @@ -142,7 +143,7 @@ function isTime(val) } } val = arrayVal.join(":"); - var tmexp = new RegExp(/^(([0-1][0-9])|(2[0-3])):((0[0-9])|([1-5][0-9])):((0[0-9])|([1-5][0-9]))$/); + var tmexp = new RegExp(/^(([0-1][0-9])|(2[0-3])):((0[0-9])|([1-5][0-9])):((0[0-9])|([1-5][0-9]))(\.[0-9]{1,6}){0,1}$/); return tmexp.test(val); }