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
COM security setting / edit limits
Problems using imap functions
SharePoint list image link
VBA assistance
custom Flex DataGrid Filter
overriding jsf default message resources mechanism
Treeview control that support thumbnails or images.
MS SQL SP if ID = 1 then where price < 25.00
powershell
Count/sum items between dates