XmlGrid Users Forum
2012-05-20 15:04:51
The following function returns true if a valid XML date value is passed:

__code__
function isDate(s)
{
var pattern = new RegExp("^([0-9]{4})-([0-1][0-9])-([0-3][0-9])$");
if(s.match(pattern))
return true;
else
return false;
};
__code__
;3412;2012-05-20 15:04:51__s__
The following function returns true if a valid XML date value is passed:

__code__
function isDate(s)
{
var pattern = new RegExp("^([0-9]{4})-([0-1][0-9])-([0-3][0-9])$");
if(s.match(pattern))
return true;
else
return false;
};
__code__
__s__~u=Zac~site=NULL__s__How to detect or validate an XML date node value in javascript__s____m__

Best view with Google Chrome