UNPKG

@manuth/woltlab-compiler

Version:

A compiler for generating WoltLab-Package `.tar` Archives and other WoltLab-Package Components

121 lines 2.5 kB
/** * Represents a time-period. */ export class TimePeriod { /** * Initializes a new instance of the {@link TimePeriod `TimePeriod`} class. * * @param minute * The minute of the period. * * @param hour * The hour of the period. * * @param dayOfMonth * The day of the month of the period. * * @param month * The month of the period. * * @param dayOfWeek * The day of the week of the period. */ constructor(minute, hour, dayOfMonth, month, dayOfWeek) { this.Minute = minute; this.Hour = hour; this.DayOfMonth = dayOfMonth; this.Month = month; this.DayOfWeek = dayOfWeek; } /** * Gets a yearly period. */ static get Yearly() { return new TimePeriod("0", "0", "1", "Jan", "*"); } /** * Gets a monthly period. */ static get Monthly() { return new TimePeriod("0", "0", "1", "*", "*"); } /** * Gets a weekly period. */ static get Weekly() { return new TimePeriod("0", "0", "*", "*", "Mon"); } /** * Gets a daily period. */ static get Daily() { return new TimePeriod("0", "0", "*", "*", "*"); } /** * Gets an hourly period. */ static get Hourly() { return new TimePeriod("0", "*", "*", "*", "*"); } /** * Gets or sets the minute of the period. */ get Minute() { return this.minute; } /** * @inheritdoc */ set Minute(value) { this.minute = value; } /** * Gets or sets the hour of the period. */ get Hour() { return this.hour; } /** * @inheritdoc */ set Hour(value) { this.hour = value; } /** * Gets or sets the day of the month of the period. */ get DayOfMonth() { return this.dayOfMonth; } /** * @inheritdoc */ set DayOfMonth(value) { this.dayOfMonth = value; } /** * Gets or sets the month of the period. */ get Month() { return this.month; } /** * @inheritdoc */ set Month(value) { this.month = value; } /** * Gets or sets the day of the week of the period. */ get DayOfWeek() { return this.dayOfWeek; } /** * @inheritdoc */ set DayOfWeek(value) { this.dayOfWeek = value; } } //# sourceMappingURL=TimePeriod.js.map