add-months: func [ date [date!] count [integer!] "Number of months to add" /local res ] [ res: make date! reduce [date/day date/month + count date/year] ; If date/day is greater than the last day in the calculated ; month, we'll be at count+1 months, so we walk backwards until ; we find the last day of the previous month. while [(res/month - date/month) > count] [res: res - 1] res ] add-one-month: func [date [date!]] [add-months date 1]
You need to create an account or log in to post comments to this site.