Class Period

Key events during a contracting process may have a known start date, end date, duration, or maximum extent (the latest date the period can extend to). In some cases, not all of these fields will have known or relevant values.

Constructors

constructor

Properties

durationInDays Optional

: undefined | number

The maximum duration of this period in days. A user interface can collect or display this data in months or years as appropriate, and then convert it into days when storing this field. This field can be used when exact dates are not known. If a startDate and endDate are set, this field, if used, should be equal to the difference between startDate and endDate. Otherwise, if a startDate and maxExtentDate are set, this field, if used, should be equal to the difference between startDate and maxExtentDate.

endDate Optional

: Date | string

The end date for the period. When known, a precise end date must be provided.

maxExtentDate Optional

: Date | string

The period cannot be extended beyond this date. This field can be used to express the maximum available date for extension or renewal of this period.

startDate Optional

: Date | string

The start date for the period. When known, a precise start date must be provided.

Methods

getRange

  • (maxDate: Date | string): number
  • Returns the number of days this period is being valid for.

isDurationValid

  • (maxDate: Date | string, durationInDays?: Period["durationInDays"]): boolean

isExtended

  • (): this is ExtendedPeriod

isRangeValid

  • (): boolean

isRanged

  • (): this is RangedPeriod
  • Used to check if this period is defined through the use of startDate and endDate fields.

setExtent

  • (startDate: NonNullable<Period["startDate"]>, maxExtentDate: NonNullable<Period["maxExtentDate"]>): void
  • Sets the extent for this period.

setRange

  • (startDate: NonNullable<Period["startDate"]>, endDate: NonNullable<Period["endDate"]>): void
  • Sets the range for this period.

Generated using TypeDoc. Made by uStudio Company with ❤️