Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Warning

Looking for the documentation on the newest versions of SIL Engine and the Simple Issue Language for Jira 8 for Server/Data Center? Click here !

Info
titleAvailability

This routine is available starting with katl-commons SIL Engine™ 2.5.5.

Syntax

addMonths(date, noMonths)

...

Excerpt

Adds a number of months to a specified date, preserving the day of month where possible.

Parameters

Parameter name

Type

Required

Description

date

date

Yes

Specifies a Date expression.

noMonthsnumberYesNumber of months to add. If given a negative number, will do subtract.

Return type

date

Example

Code Block
function addMonthsInDesc(date d, int noMonths){
    desc += "Date " + d + " + " + noMonths + " months = " + addMonths(d, noMonths) + "\n";
}

desc = "";
addMonthsInDesc("2012-01-31", 1);
addMonthsInDesc("2012-04-30", -2);
addMonthsInDesc("2013-01-31", 1);
addMonthsInDesc("2013-04-30", -2);
addMonthsInDesc("2012-01-31", 12);
addMonthsInDesc("2012-01-31", -1);

...

Date 2012-01-31 00:00:00 + -1 months = 2011-12-31 00:00:00

 


See also

Filter by label (Content by label)
showLabelsfalse
max100
showSpacefalse
cqllabel = "date_routines"
labelsdate_routines