Microsoft
Software
Hardware
Network
Question : Adding days to an input date value.
Hi all,
I need your help with this!
I do have a date in this format (30-Jul-2010) and it is shown in a text box along with a calendar icon so the user can select the date by clicking on the icon.
The problem that I’m facing is that I need to add number of days to that date and display them in textboxes.
Ex:
Date1 = selected Date + 1 day
Date2 = selected Date + 3 days
Date3 = selected Date + 4 days
Date4 = selected Date + 5 days
I tried the following in javascript but its not working:
TDate=”30-Jul-2010”;
var newTDate = new Date(formatDate(TDate));
document.getElementById("D
ate1").val
ue=newTDat
e.getDate(
)+1;
document.getElementById("D
ate2").val
ue=newTDat
e.getDate(
)+3;
document.getElementById("D
ate3").val
ue=newTDat
e.getDate(
)+4;
document.getElementById("D
ate4".valu
e=newTDate
.getDate()
+5;
function formatDate(sDate)
{
var dateSplit=sDate.split("-")
;
newDate=dateSplit[1] + " " + dateSplit[0] + "," + dateSplit[2];
return newDate
}
Appreciate your help…..thanks in advance.
Answer : Adding days to an input date value.
Hi there, I think this may be what you need:
http://weblogs.asp.net/raj
bk/archive
/2007/05/2
6/changing
-the-
conne
ctionstrin
g-of-a-wiz
ard-genera
ted-tablea
dapter-at-
runtime-fr
om-an-obje
ctdatasour
ce.aspx
Random Solutions
IE error only, object doesn't support this property or method
How to open old tethereal pcap files?
Script to change CD-Rom drive letter
SharePoint styling broken after migration (Urgent, Screenshots attached)
a program is attempting to send the following email message on your behalf - Windows Live mail
Xerox Scan to email issue - Gmail Google Apps Premiere
Best Method for Reporting on and Editing Large Amounts of Data
SQL 2008 SP1 Ghost count!
Samsung 160 G disk bad sector at 30.91%, HDD Reg. still finding bad sectors but no fix? Why?
Trying to redirect a user from http to https automatically. Windows 2008 running II7