project QadFinancials > class BGLCalendar > method GetDate

function returns date

Description

This method is used to return the corresponding date for the new period.


Parameters


itDateinputdateThe old date
iiOldYearinputintegerThe old year
iiNewYearinputintegerThe new year


Internal usage


QadFinancials
method BGLCalendar.DataNewMultipleCopyPeriodYear


program code (program1/bglcalendar.p)

if day (itDate) = 29 and month (itDate) = 2 then
    assign
        viYear = year (itDate) + iiNewYear - iiOldYear
        viDay  = if viYear modulo 4 = 0 and
                    viYear modulo 100 <> 0 or
                    viYear modulo 400 = 0
                 then 29
                 else 28
        vtDate = date (month (itDate),
                       viDay,
                       viYear).
else
    assign
        vtDate = date (month (itDate),
                       day (itDate),
                       year (itDate) + iiNewYear - iiOldYear).

return vtDate.