Click here to Skip to main content
15,886,519 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Hi friends, I have a requirement in asp.net , here is two texboxes(startdate and enddate) with two calendarextender. we can compare selected dates in both textboxes using jquery or javascript.
Posted

I suppose no one[^] has ever had such problem, yet.
 
Share this answer
 
Comments
Prasad Khandekar 17-Sep-13 6:02am    
My 5+
CPallini 17-Sep-13 6:15am    
Thank you.
AndrewBucklin 29-Dec-18 16:08pm    
I googled for this, and this was one of the first results.
Hello,

Following code snippet demonstrates how data comparison is done using JavaScript.
JavaScript
var dtPrev = new Date();
dtPrev.setFullYear(2100, 0, 14);
var dtToday = new Date();

if (dtPrev > dtToday) {
    alert("Today is before 14th January 2100");
} else {
   alert("Today is after 14th January 2100");
}

Regards,
 
Share this answer
 
Comments
CH Guravaiah 17-Sep-13 13:52pm    
I want from CalendarEnder in textboxes in asp.net . Validations should be in jquery or javascript
Prasad Khandekar 18-Sep-13 22:40pm    
You can use JQuery Calendar for input and use above code for comparison.
Member 11047305 25-Aug-15 6:02am    
its not working
 
Share this answer
 
Comments
Member 13138388 18-May-17 6:20am    
Thanks man...
 
Share this answer
 
Comments
Member 13138388 18-May-17 6:20am    
thanks man...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900