Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi guys...

"It accepts only present date and next date not for previous date"..

disabled previous dates in my date calender only enabled present and next
Posted
Updated 8-Mar-12 22:48pm
v5
Comments
member60 9-Mar-12 4:55am    
what accepting present date and what is not accepting prevoius date ?
try to elaborate your question please !

1 solution

try:
C#
<script language="javascript">
<!--
today = new date();
todayDay = today.getdate();
todayMon = today.getMonth();
todayYear = today.getYear();
todayDay = todayDay - 1;
if (todayYear < 2000) todayYear += 1900;

if (todayMon == 0) { todayMonth = "January"; }
else if (todayMon == 1) { todayMonth = "February"; }
else if (todayMon == 2) { todayMonth = "March"; }
else if (todayMon == 3) { todayMonth = "April"; }
else if (todayMon == 4) { todayMonth = "May"; }
else if (todayMon == 5) { todayMonth = "June"; }
else if (todayMon == 6) { todayMonth = "July"; }
else if (todayMon == 7) { todayMonth = "August"; }
else if (todayMon == 8) { todayMonth = "September"; }
else if (todayMon == 9) { todayMonth = "October"; }
else if (todayMon == 10) { todayMonth = "November"; }
else if (todayMon == 11) { todayMonth = "December"; }
else { todayMonth = todayMon; }

document.write(todayMonth + " " + todayDay + ", " + todayYear);


and have a look at :http://www.webmasterworld.com/javascript/3025998.htm[^]
 
Share this answer
 
v2
Comments
tirumalarao123 9-Mar-12 4:20am    
Ok nice but where should i call this script....
member60 9-Mar-12 5:05am    
check the comment added to your question first

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