.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old March 20th, 2003, 08:03 PM
BigCed_21 BigCed_21 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 3 BigCed_21 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
not receiving date

I'm trying to display the date of expiration off the calculation of the date_inspection. the date od expiration is 30 days from the date of inspection.<br><br>Can anybody see what's wrong with this code:<br><br><html><br><script language="javascript"><br> <br> function monthsahead() <br> {<br> var newdate = document.inspection.Date_Inspection_Month.value + '/1/' + document.inspection.Date_Inspection_Year.value;<br> var today = new Date(newdate);<br> var noofmonths = document.inspection.Year_TypeDef_Duration_Months.o ptions[document.inspection.Year_TypeDef_Duration_Months.s electedIndex].value;<br> var date = new Date(today.getYear(),today.getMonth() + eval(noofmonths),today.getDate(),today.getHours(), today.getMinutes(),today.getSeconds());<br><br> document.inspection.exp.value = getDisplayDate(date);<br> }<br> function getDisplayDate(passedDate) <br> {<br> // uses getDisplayMonth()<br> // returns passed Date formatted nicely<br> // Month day, Year mmmm dd, yyyy<br><br> theDate = new Date(passedDate);<br><br> // split into day, month, year<br> iDay = theDate.getDate();<br> iMonth = theDate.getMonth();<br> iYear = theDate.getFullYear();<br><br> sDisplayDate = iMonth + eval(1) + "/" + iYear;<br><br> return sDisplayDate;<br> }<br></script><br><br>here's the code inside the connection:<br><br>Response.Write "<TR><td align='center'><b>DATE INSPECTED</td><td colspan='1'><b>STATE NUMBER<td align='right'><b>NATIONAL BOARD #</td><td align='center'><b>EXPIRATION DATE</td></tr>"<br> <br> Response.Write "<tr><td align='center'>" & Date_Inspection & "</td><td align='center'>" & state_no & "</td><td width='20%'>" & Nat_Brd_No & "</td><td align='center'><input type='text' size='10' name='exp'></td></tr>" <img border="0" src="/forum/emoticons/jumpin.gif" height="31" width="31" alt="jumpin" />

Reply With Quote
  #2  
Old March 24th, 2003, 07:45 AM
bkalicharan bkalicharan is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 51 bkalicharan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 42 m 59 sec
Reputation Power: 6
Hi,<br><br>I think u can do this very simply..<br>var objDate = new Date("2/29/2003");<br>will give u the March 1st Date.. b/c in this year there are only 28 days in February..<br>To get +30 days of ur date_inspection use this..<br>var objDate = new Date(month+"/"+parseInt(date+30)+"/"+year);<br><br>thats its..<br>try it..<br>Regards,<br>Kalicharan Barath Boorugu

Reply With Quote
Reply

Viewing: ASP Free ForumsProgramming.NET Development > not receiving date


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT