javascript to add days to a date

I found a couple of posts on here detailing some javascript to calculate a date by adding days to a starting date and thought I had the javascript down pat but cant get it to work at all. I am using Skuid Platform We have a field called “MostRecentContact”, another number field for the days interval, "ScheduledContactFrequency"and want the result in a date field “NextDue” - none of the fields are UI fields and none are read only. The javascript is below… does anything dramatically wrong jump out at anyone ) var field = arguments[0], $ = skuid.$, value = arguments[1], SourceDate = new Date(field.row.MostRecentContact.substr(0, field.row.MostRecentContact.lastIndexOf(‘.’))), DaysToAdd = skuid.$M(‘Account’).getFirstRow().ScheduledContactFrequency, NextDue = SourceDate + DaysToAdd; field.element.append(NextDue) Any help would be greatly appreciated )

any help would be hugely appreciated )