Versions Compared

Key

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

Abstract

This code snippet adds a certain number of minutes/hours/days/weeks/months to a Date/Date-Time picker field.

Logic

Add the number of minutes/hours/days/weeks/months to the date field using Use(TimeCategory

Snippet 

Code Block
languagejs
linenumberstrue
use (groovy.time.TimeCategory) {
     return <Date Object> + <Number of units>.<Unit>
 }

...

PlaceholderDescriptionExample
<Date Object>Access a date fieldissue.get("created")
<Number of units>
The number of units to be added5
<Unit>is one of "minutes","hours","days" "weeks" or "months"months

...

...