Date function - total NEWBIE

C

Chris D

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
 
C

Chris D

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.
 
D

Darren Neimke

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() ;
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top