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
Combobox values default
auto run lightbox
DNS Round Robin
SecureCRT, WebHost Manager and Keys
Using VBA to read inbox of non-default mailbox
Does anyone know how to make a disk image from the iphone memory?
Macro that will create 52 otherwise identical named ranges, each with a different number in the middle.
NULLS FIRST, NULLS LAST on order by
phpbb forum
Incremental search listbox w/ SQL Server w/ ability to append records to the serached table