Check the two-date sequence
* Return value:
* If one of the dates is null, the checksum passes and returns true
* If the start date is earlier than or equal to the expiration date, the validation passes and returns True
* If the start date is later than the end date, return false reference information: The start date cannot be later than the end date.
*/
function Checkdateearlier (strstart,strend)
{
if (checkisvaliddate (strstart) = = False | | Checkisvaliddate (strend) = = False)
return false;
If one of the inputs is empty, the check is passed
if ((Strstart = "") | | (Strend = ""))
return true;
var arr1 = Strstart.split ("-");
var arr2 = Strend.split ("-");
var date1 = new Date (Arr1[0],parseint (Arr1[1].replace (/^0/, ""),-1,arr1[2]);
var date2 = new Date (Arr2[0],parseint (Arr2[1].replace (/^0/, ""),-1,arr2[2]);
if (arr1[1].length = 1)
ARR1[1] = "0" + arr1[1];
if (arr1[2].length = 1)
ARR1[2] = "0" + arr1[2];
if (arr2[1].length = 1)
ARR2[1] = "0" + arr2[1];
if (arr2[2].length = 1)
arr2[2]= "0" + arr2[2];
var D1 = arr1[0] + arr1[1] + arr1[2];
var D2 = arr2[0] + arr2[1] + arr2[2];
if (parseint (d1,10) > parseint (d2,10))
return false;
Else
return true;
}//
JS Email Address Verification
* Check whether the string is email type
* Return value:
* If NULL, define checksum pass, return True
* If the string is email type, check pass, return True
* If the email is not valid, return FALSE reference message: Email format is not right!
*/
function checkemail (str)
{
//If NULL, pass checksum
if (str == "")
return true;
if (str. Charat (0) == "." | | Str.charat (0) == "@" | | str.indexof (' @ ', 0) == -1
| | str.indexof ('. ', 0) == -1 | | str.lastindexof ("@") == str.length-1 | | str.lastindexof (".") == str.length-1)
return false;
else ;
return true;
}//