Versions Compared

Key

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


Page properties
hiddentrue
Tech review

Status
colourYellow
titleReady for review

Style guide

Status
colourYellow
titleReady for review

Page status
Status
colourGreen
titlecomplete
Status
titletodo
Status
colourYellow
titleReady for review
Status
colourGreen
titledone
Status
colourRed
titleflagged

Panel

On this page

Table of Contents
exclude(On this page).*
typeflat
separatorpipe



Calendar: A system on which we
UI Text Box
sizemedium
typeinfo

What is a JWT calendar?

It defines custom schedules that can be used for time calculations like time subtraction and time addition.

The basic operations that can be done using the JWT calendars are:

  1. Belonging: Check if a certain time does or does not belong to a particular calendar.
  2. Time addition: Calculates the new time instant by adding a certain time duration to the time suggest defined by a particular calendar.
  3. Time subtraction: Calculates the difference between two particular time instants by a time subset defined by a particular calendar. 

Where to find JWT Calendars?

Head over to Administration → Manage apps → Jira Workflow Toolbox → Calendars

JWT calendars syntax

Main concepts

A calendar is a system on which JWT will be able to do time calculations.

Calendars are

Each calendars should be composed of at least one time specifier.

Each calendar configuration is highly flexible but the underlying specification must follow a dedicated syntax.


Time

Specifier: They are

specifiers

A simple time specifier is composed of a time definition or frame and a

block. (They are written in

scope definition in the following

way: <time_definition> { <block_content> } ).
  • Time definition: Defines a part of the time continuum (a set of real numbers ℝ).
  • Block: Is written between braces {} and defines a scope where the lower level time specifiers can be written.

format: 

Code Block
<frame> { <scope>; } #e.g. JAN-MAR {08:00 - 12:00;}


Frame definition

Defines the time frame to be included in the specification (e.g. JAN-MAR)

Scope definition

The scope definition further refines a time frame. Multiple time definitions and scopes can be specified and nested based on their hierarchy level

Each scope needs to be ended with a ";".

Hierarchy levels

Time specifiers are ordered in five hierarchical levels

Time Specifier's Level: Time specifiers are ordered in a 5 level hierarchy

:

  1. Global
  2. Year
  3. Month
  4. Week
  5. Day
UI Text Box
typeinfo

A time specifier of a particular level is always explicitly or implicitly contained in a time specifier of the immediately higher level (e.g. a day is contained in a month).

When the higher level time specifier is not

written

configured (e.g. no month defined) , then it

's

is implicitly contained in an unrestricted higher level time specifier (e.g.

year).


UI Expand
expandedtrue
titleExamples for different levels


CalendarDescription


Code Block
languagebash
linenumberstrue
08:00-18:00;


Every day between 8AM and 6PM.


Code Block
languagebash
linenumberstrue
MON-FRI{						#WEEK
   08:00-12:00, 13:00-18:00; 	#DAY
		}


Only during the week, since the week "level" is higher than the day level.


Code Block
languagebash
linenumberstrue
JAN{
	MON-FRI{							#WEEK
   			08:00-12:00, 13:00-18:00; 	#DAY
			}
	}


Only in January, since the year "level" is higher than the week or day level..



Absolute vs. relative time fames

Time specifiers can be classified into two categories:

Absolute

  • Time Specifier's Priority: Time specifiers have also a priority associated, so that when 2 time specifiers overlap in the same level, the one with the highest priority is applied. Time specifiers with the same priority in the same level are not allowed to overlap, i.e., the intersection of their time definitions must be empty.
  • Time Specifier's Category: We can classify time specifiers in 2 categories:Absolute:

    Defines the unique and specific parts of the time continuum. This category of time specifiers represents the ones in the global level.

    Code Block
    languagebash
    2020/03/25 #this is a unique and specific date

    Relative

    :

    Define parts of the time in the context of other time specifiers

    , i.e., the actual part of the time continuum defined

    . The definition depends on the time specifier where it is contained. This category of time specifiers is contained in the all levels besides the global.

    Code Block
    languagebash
    FRI {
        08:00 - 15:00; #the time specifier depends on the "container". In this a day of the week, which is Friday.
    } 

    Comments

    Comment:

    JWT calendars supports single-line comments. Comments begin with a #. e.g.:

    Code Block
    languagebash
    #Summer Calendar
    Time specifiers



    Examples and syntax details

    UI Expand
    expandedtrue
    titleOverview of different levels and priorities

    The following table represents all the available time specifiers ordered by level and

    priority:Level

    priority.

    UI Text Box
    typetip

    Time specifiers each have a dedicated priority. In case that two or more time specifiers overlap in the same level, the one with the highest priority is applied.

    Time specifiers with the same priority in the same level are not allowed to overlap, i.e., the intersection of their time definitions must be empty.



    High priority
    Interval list
    Medium priorityLow priority
    Level


    Global

    Date list

    2018

    Code Block
    languagebash
    2020/03/25,
    2018
     2020/AUG/18

    
    2017/01/01, 2017/05/01, 
    2017/12/25-2017/12/31

     #can contain intervals


    Date

    Code Block
    languagebash
    UI Text Box
    typenote

    Can contain intervals.

    Date
    2018/JUN/15-2018/SEP/15

    
    2018/01/01-2018/01/07, 2018/04/10-2018/04/20


    Year list


    Code Block
    languagebash
    2000, 2005, 2010

    
    2000-2011

    
    2010-2015, 2018, 2020-2025

    UI Text Box
    typenote
    Can contain intervals.
     #can contain intervals


    Year

    Month-Day

    List

    list

    Code Block
    languagebash
    JAN/1, MAY/1, JUL/4, DEC/25


    Month-

    Day

    day

    Code Block
    languagebash
    MAR/20-MAR/25

    
    AUG/1-AUG/15, NOV/5-NOV-15


    Month

    List

    list

    Code Block
    languagebash
    JAN, MAR, MAY, DEC

    
    JAN-JUN, SEP-DEC

    JAN-MAR,
     #can contain intervals
    MAY, JUL, OCT-DEC
    UI Text Box
    typenote

    Can contain intervals.

    Day


    Month

    Day of month list

    Code Block
    languagebash
    1, 15, 30
    1-5, 15, 25-3
    1, 15-31
    25-5 #can contain intervals




    Week

    Day of week list

    Code Block
    languagebash
    MON-THU
    MON-WED, FRI
    MON, WED, FRI
    SAT-MON, WED #can contain intervals




    Day

    Whole day

    Code Block
    languagebash
    Whole Day
    00:00-00:00;


    Time

    Code Block
    languagebash
    8:00-15:00;

    
    8:00-15:00, 16:00-19:00;

    
    21:00-3:00;


    Empty

    ;
    UI Text Box
    typenote

    Used for defining holidays.

    MonthDay of Month List
    1, 15, 30
    1-5, 15, 25-3
    1, 15-31
    25-5
    Code Block
    languagebash
    ; #Can be used to exclude dates


    UI Text Box
    type
    note
    tip

    Use ; to specify holidays

    Can contain intervals

    .

    WeekDay of Week List
    MON-THU
    MON-WED, FRI
    MON, WED, FRI
    SAT-MON, WED



    Anchor
    examplespecification
    examplespecification

    UI Expand
    title
    UI Text Box
    typenote

    Can contain intervals.

    Anchorexamplespecificationexamplespecification
    Example specifications

    Get some inspiration by looking at the example specifications below.

    Examples

    CalendarDescription


    Code Block
    languagebash
    linenumberstrue
    08:00-15:00, 16:00-20:00;


    Any date-time with time part between 08:00 and 15:00, or 16:00 and 20:00.

    UI Text Box
    typeinfo
    By convention 15:00 and 20:00
    time instants are out
    (the outer limits of the time frame) are outside of the calendar definition.



    Code Block
    languagebash
    linenumberstrue
    MON-FRI{08:00-15:00, 16:00-20:00;}


    Mondays to Fridays from 08:00 to 15:00 and from 16:00 to 20:00.


    Code Block
    languagebash
    linenumberstrue
    MON-THU{08:00-15:00, 16:00-20:00;} FRI{08:00-15:00;}


    • Mondays to Thursdays from 08:00 to 15:00 and from 16:00 to 20:00.
    • Fridays from 08:00 to 15:00.


    Code Block
    languagebash
    linenumberstrue
    # Winter Calendar
    MON - THU {
       08:00 - 15:00,
       16:00 - 20:00;
    }
     
    FRI {
        08:00 - 15:00;
    }
     
    # Summer Calendar
    JUN/15 - SEP/15 {
        MON - FRI {
            08:00 - 14:30;
        }
    }


    • From June 15th to September 15th
    , Mondays
    • : Mondays to Fridays from 8:00 to 14:30.
    • For the rest of the year, Mondays to Thursdays from 08:00 to 15:00 and from 16:00 to 20:00. Fridays from 08:00 to 15:00.


    Code Block
    languagebash
    linenumberstrue
    # Winter Calendar
    MON - THU {
       08:00 - 15:00,
       16:00 - 20:00;
    }
     
    FRI {
        08:00 - 15:00;
    }
     
    # Summer Calendar
    JUN/15 - SEP/15 {
        MON - FRI {
            08:00 - 14:30;
        }
    }
     
    # Annual Holidays
    JAN/1, MAY/1, NOV/1, DEC/25 {;}
     
    # 
    2017
    2021 Holidays
    
    2017
    2021/JAN/12, 
    2017
    2021/APR/13, 
    2017
    2021/APR/14, 
    2017
    2021/NOV/23 {;}
    From June 15th to September 15th, Mondays to Fridays from 8:00 to 14:30.
    For the rest of the year, Mondays to Thursdays from 08:00 to 15:00 and from 16:00 to 20:00. Fridays from 08:00 to 15:00. UI Text Box
    typeinfo
    We added also a specification for


    This calendar additionally contains a specification for:

    • annual holidays, i.e., holidays that have the same day every year
    , and for
    • particular holidays per year
    holidays
    • (
    2017
    • 2021 in the example).



    Code Block
    languagebash
    linenumberstrue
    # NEW Calendar 
    from
    effective 1st December 
    2017 on
    2020
     
    # Winter Calendar
    MON-THU {
       08:30 - 15:30,
       16:00 - 19:30;
    }
     
    FRI {
       08:00 - 15:00;
    }
     
    # Summer Calendar
    JUN/15 - SEP/15 {
       MON - FRI {
          08:00 - 14:30;
       }
    }
     
    # Annual Holidays
    JAN/1, MAY/1, JUL/4, NOV/1, DEC/25 {;}
     
    # 
    2018
    2021 Holidays
    
    2018
    2021/03/27 - 
    2018
    2021/03/30, 
    2018
    2021/10/22 {;}
     
    # Current calendar 
    Calendar
    valid up to 30th November 
    2017
    2020
    
    2000/01/01 - 
    2017
    2020/11/30 {
     
       # Winter Calendar
       MON-THU {
          08:00 - 15:00,
          16:00 - 20:00;
       }
     
       FRI {
          08:00 - 15:00;
       }
     
       # Summer Calendar
       JUN/15 - SEP/15 {
          MON - FRI {
             08:00 - 14:30;
          }
       }
     
       # Annual Holidays
       JAN/1, MAY/1, NOV/1, DEC/25 {;}
    }
     
    # 
    2017
    2020 Holidays
    
    2017
    2020/JAN/12, 
    2017
    2020/APR/13, 
    2017
    2020/APR/14, 
    2017
    2020/NOV/23 {;}


    This example combines two calendars.

    future calendar coming into effect on December 1st of 2021 and the currently valid calendar.


    UI Text Box
    typeinfo

    Since the 2nd calendar is wrapped in a global time specifier with higher priority it is the one that is currently valid.

    Code Block
    2000/01/01 - 2020/11/30 { #global specifier
    ...
    }





    UI Expand
    titleBackus–Naur Syntax Specification


    UI Text Box
    typeinfo

    The syntax of the calendar specification follows the Backus-Naur form. Read more about the details.


    <schedule> ::= <global_level_specifier> +

    <global_level_specifier> ::= <date_interval_list> { <year_level_specifier>* } | <date_list> { <year_level_specifier>* } | <year_list> { <year_level_specifier>* } | <year_level_specifier>+

    <year_level_specifier> ::= <month_day_list> { <month_level_specifier>* } | <month_day_interval_list> { <month_level_specifier>* } | <month_list> { <month_level_specifier>* } | <month_level_specifier>+

    <month_level_specifier> ::= <day_of_month_list> { <week_level_specifier>* } | <week_level_specifier>+

    <week_level_specifier> ::= <day_of_week_list> { <day_level_specifier>* } | <day_level_specifier>+

    <day_level_specifier> ::= <time_interval_list>

    <time_interval_list> ::= <time_interval> (, <time_interval>)* ; | ;

    <time_interval> ::= <time_literal> - <time_literal>

    <time_literal> examples: 00:006:3009:5513:01 and 23:59.

    <date_interval_list> ::= <date_interval> (, <date_interval>)*

    <date_list> ::= (<date_literal> | <date_interval>) (, (<date_literal> | <date_interval>))*

    <date_interval> ::= <date_literal> - <date_literal>

    <date_literal> examples: 2017/06/272017/JUN/272018/01/01 and 2020/MAR/2.

    <year_list> ::= (<year> | <year_interval>) (, (<year> | <year_interval>))*

    <year_interval> ::= <year> - <year>

    <year> examples: 19912000 and 2017.

    <month_day_list> ::= <month_day> (, <month_day>)*

    <month_day_interval_list> ::= <month_day_interval> (, <month_day_interval>)*

    <month_day_interval> ::= <month_day> - <month_day>

    <month_day> ::= <month> / <day_of_month>
    examples: JAN/1MAR/02AUG/18 and DEC/25.

    <month_list> ::= (<month> | <month_interval>) (, (<month> | <month_interval>))*

    <month> ::= JAN | FEB | MAR | APR | MAY | JUN | JUL | AUG | SEP | OCT | NOV | DEC

    <day_of_month_list> ::= (<day_of_month> | <day_of_month_interval>) (, (<day_of_month> | <day_of_month_interval>))*

    <day_of_month_interval> ::= <day_of_month> - <day_of_month>

    <day_of_week_list> ::= (<day_of_week> | <day_of_week_interval>) (, (<day_of_week> | <day_of_week_interval>))*

    <day_of_week> ::= MON | TUE | WED | THU | FRI | SAT | SUN



    In this example we show how to introduce some modifications in the previous calendar that will be applied since  December 1st, 2017 on, keeping the old calendar valid only up to 30th November 2017.

    Excerpt Include
    DECADIS:Contact support
    DECADIS:Contact support
    nopaneltrue


    Page properties
    hiddentrue


    Tech review

    Status
    colourGreen
    titledone

    Style guide

    Status
    colourGreen
    titledone

    Page status

    Status
    colourGreen
    titlecomplete

    Status
    titletodo
    Status
    colourYellow
    titleReady for review
    Status
    colourGreen
    titledone
    Status
    colourRed
    titleflagged