Calendar Declarations

Calendar declarations became an option starting with version 7.0(35). To add a calendar in a Build, Dive, or cPlan file, you can add a calendar tag to the script. One reason you might want to add a calendar is to customize the formats used for a built-in calendar. For example, the format for the year-month period type of the standard calendar is "YYYY/MM", so February 2017 is displayed as 2017/02. To change the display to 2017-Feb, you can write the following calendar declaration:

calendar "modified-standard" type="standard" {
    period "year-month" format="YYYY-MMM"
  }

For example, using that declaration in a Build file:

build {
  // change the formatting of the standard calendar:
  calendar "modified-standard" type="standard" {
    period "year-month" format="YYYY-MMM"
  }
  default-calendar "modified-standard"
  text-input "data.txt" {
    // YearMo will use the format "YYYY-MMM":
    column "YearMo" type="period" period-type="year-month"
  }
  ...

NOTES:

  • Once declared, a calendar can be reference by columns in the Build script, as well as by add operations.
  • Calendar declarations (whether in calendar files, Build scripts, Dive scripts, or Measure Factory scripts) all use the period tag to declare a period type.
  • Type specifications (in input columns and date-rollup) all use the period-type= attribute to identify the period type that applies.

See also: