Intelligent Reports provides methods for some objects to provide additional functionality to transform the object.
Intelligent Reports provides the following methods for datetime objects. A datetime object represents a specific point in time on a specific date.
Some JIRA fields are date objects only, they do not have an associated time. Use the datetime
function to convert these dates into datetimes to use the following methods on them.
The format
method on date objects allows you to format a date into a string in your preferred date and time format. The formats supported are those supported by the Joda time library for Java. You can see the supported formats here.
now().format("YYYY")
now().format("d MMMM YYYY")
now().format("YYYY-MM-dd")
now().format("hh:mm d MMMM")
The before
method on date objects allows you to test if a datetime is before the specified date. The single argument is the date to test against. The return value is true if the argument is before the date, false otherwise.
now().before(now().endOfDay())
The after
method on date objects allows you to test if a datetime is after the specified date. The single argument is the date to test against. The return value is true if the argument is after the date, false otherwise.
now().after(now().startOfDay())
The addDays
method on date objects allows you to add or subtract a number of days from the date. The single argument is a number of days to add; you can provide a negative number to subtract days.
now().addDays(1)
now().addDays(-7)
The addMonths
method on date objects allows you to add or subtract a number of months from the date. The single argument is a number of months to add; you can provide a negative number to subtract months.
now().addMonths(1)
now().addMonths(-6)
The addYears
method on date objects allows you to add or subtract a number of years from the date. The single argument is a number of years to add; you can provide a negative number to subtract years.
now().addYears(1)
now().addYears(-1)
The startOfDay
method on date objects allows you to get the date representing the start of the day, effectively setting the time component of the date to midnight.
now().startOfDay()
The endOfDay
method on date objects allows you to get the date representing the end of the day, effectively setting the time component of the date to one second before midnight.
now().endOfDay()
The startOfMonth
method on date objects allows you to get the date representing the start of the month, effectively setting the time component of the date to midnight, and the day of the month to the first.
now().startOfMonth()
The endOfMonth
method on date objects allows you to get the date representing the end of the month, effectively setting the time component of the date to one second before midnight, and the day of the month to the final day in the given month.
now().endOfMonth()
The startOfYear
method on date objects allows you to get the date representing the start of the year, effectively setting the time component of the date to midnight, and the date to the first of January.
now().startOfYear()
The endOfYear
method on date objects allows you to get the date representing the end of the year, effectively setting the time component of the date to one second before midnight, and the day of the month to the 31st of December.
now().endOfMonth()