2
votes

I'm trying to set a default value on an inputText field that has a dateTimeHelper associated with it. The following computed default value works:

return @Today();

img1

However, I need to set the default date value 7 days from a date that is stored as a string on a document. So I tried the following:

var date:NotesDateTime = session.createDateTime(doc.getItemValue("EffDate")[0]);
log.logEvent("date= " + date); // returns 09/01/2013

var newDate = new Date(date);
log.logEvent("newDate= " + newDate); // returns NaN

var datePlus7 = @Adjust(newDate,0,0,7,0,0,0,"[InLocalTime]");
log.logEvent("datePlus7= " + datePlus7); // returns NaN

return datePlus7;

Which does not work because datePlus7 is NaN. Any ideas are greatly appreciated.

1

1 Answers

5
votes

Use method toJavaDate() of DateTime class instead of Date constructor "new Date(date)":

var newDate = date.toJavaDate()