Hi - I've a date picker called StartDate. I need a textbox to show the day
selected+1.
ie day(StartDate)+1
How do I do that??? Thanks ... Chris
Chris D - 20 Dec 2004 20:29 GMT
Sorry - what I need to be able to do is equivilent to - day(StartDate+1) so
that the text box shows the DayOfTheWeek for the following day.
> Hi - I've a date picker called StartDate. I need a textbox to show the day
> selected+1.
>
> ie day(StartDate)+1
>
> How do I do that??? Thanks ... Chris
Darren Neimke - 20 Dec 2004 20:55 GMT
Chris...
You could handle the OnAfterChange event of your calendar control to grab
the value and calculate the new value like this:
function msoxd_my_field1::OnAfterChange(eventObj)
{
if (eventObj.IsUndoRedo) { return ; }
var dateField = XDocument.DOM.selectSingleNode('//my:myDateField');
var textField = XDocument.DOM.selectSingleNode('//my:myTextBoxField');
if( dateField.text ) {
var tmpDate1 = new Date(dateField.text) ;
var tmpDate2 = new Date( tmpDate1.getFullYear(),
tmpDate1.getMonth(), tmpDate1.getDate() + 1 ) ;
textField.text = tmpDate2.toDateString() ;
}
}