|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
hii!!
i have 2 dates one in the format mm/dd/yyyy which is the date on the server. and the second , mm-dd-yyyy, which i get from a calendar control i am using. i need to write a function to compare both the dates using javascript !! any ideas ? thanks....
__________________
“Life may not be the party we hoped for, but while we are here we should sing, dance and be merry all the time....... "
|
|
#2
|
||||
|
||||
|
Code:
function compareDate()
{
logInDate =document.getElementById("logged").value;
tmp1=logInDate.split("/")
dateOfProd=document.getElementById("E_date").value;
tmp=dateOfProd.split("-")
var logdate = new Date(tmp1[2], tmp1[0], tmp1[1]);
var proddate = new Date(tmp[2], tmp[0], tmp[1]);
if(logdate<proddate)
{
return false;
}
}
did it like this... |
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > JavaScript - Compare dates |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|