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
Aside from Flowplayer, recommend a good video/audio player for the web?
How to use the processing core library to create a PIMAGE in Java Netbeans?
I frequently get BSOD with error message DRIVER_IRQL-NOT_LESS_OR_EQ
UAL on windows vista/7
Download conexant fusion 878a drivers for Windows 7
Export Data to XML File from SQL Database
Google Apps Gmail and legacy MS Exchange (SBS) 2003 Synchronisation
Need help resolving a issue with the home folder not being mapped to client from 2003 DC
Autocomplete
PHP Sessions
New Build (ASUS P7H55D-M EVO) not booting properly, can't install OS