Hello,
Can any one please help on how to add a year to the current date field.
e.g 7/19/2011 plus a year = 7/19/2012
Thanks,
Han Dao
Solved! Go to Solution.
Views
Replies
Total Likes
If you had a field DateTimeField1 and wanted to display the following year in DateTimeField2, you could do the following in JavaScript;
var d1 = util.scand("yyyy-mm-dd", DateTimeField1.rawValue);
if (d1 !== null)
{
d1.setFullYear(d1.getFullYear()+1);
DateTimeField2.rawValue = util.printd("yyyy-mm-dd", d1);
}
Good luck
Bruce
Views
Replies
Total Likes
If you had a field DateTimeField1 and wanted to display the following year in DateTimeField2, you could do the following in JavaScript;
var d1 = util.scand("yyyy-mm-dd", DateTimeField1.rawValue);
if (d1 !== null)
{
d1.setFullYear(d1.getFullYear()+1);
DateTimeField2.rawValue = util.printd("yyyy-mm-dd", d1);
}
Good luck
Bruce
Views
Replies
Total Likes
It WORKS!
Thanks Bruce,
Han
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies