In my app, I'm trying to autocomplete an ExpireDate field. I want my app to first check whether if ReceiptTermId is bigger than 0. And if it is bigger than 0, I want it to autocomplete the ExpireDate field by adding ManufacturingDate and ExpireTermYear. I currently could not achieve that it gives an error since ManufacturingDate is a Date and ExpireTermYear is a number. ExpireTermYear is kept as in months in the background, and I want it to add that to the ManufacturingDate as in years. That's why I divide it by 12. Here is my code, how can I add those two?
displayExpireDate(row: IReceiptTerm, w:IWorkItem){
if(row.ReceiptTermId > 0){
w.ExpireDate = w.ManufacturingDate + (row.ExpireTermYear/12);
}
}