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 sometimes fails to connect, gets worse with time since reboot
Blackberry browser 400 error - socketexception Connection reset
Video mp4
Perl Iteration issue
extending jQuery autocomplete plugin functionality
Display logon message to new users at first logon.
server name
Looking for Excel User Function not Text to Columns to Convert text values to date values.
Why does my outlook show three tasks for every email I mark?
builing a basic Advertise with Us Functionality!