universal-common
Version:
Library that provides useful missing base class library functionality.
107 lines (106 loc) • 2.76 kB
TypeScript
/**
* @file DayOfWeek.js
* @description Defines a static class for representing days of the week as numerical constants.
*/
/**
* A static class that provides numerical constants for the days of the week,
* starting with Sunday as 0 and ending with Saturday as 6.
*
* This class is designed to be used as an enumeration, allowing for clear and
* consistent representation of days in applications.
*
* @example
* import DayOfWeek from './DayOfWeek.js';
*
* console.log(DayOfWeek.MONDAY); // Output: 1
*
* if (someDay === DayOfWeek.FRIDAY) {
* // Do something specific for Friday
* }
*/
export default class DayOfWeek {
/**
* Represents Sunday.
* @private
* @static
* @type {number}
*/
private static "__#9@#SUNDAY";
/**
* Represents Monday.
* @private
* @static
* @type {number}
*/
private static "__#9@#MONDAY";
/**
* Represents Tuesday.
* @private
* @static
* @type {number}
*/
private static "__#9@#TUESDAY";
/**
* Represents Wednesday.
* @private
* @static
* @type {number}
*/
private static "__#9@#WEDNESDAY";
/**
* Represents Thursday.
* @private
* @static
* @type {number}
*/
private static "__#9@#THURSDAY";
/**
* Represents Friday.
* @private
* @static
* @type {number}
*/
private static "__#9@#FRIDAY";
/**
* Represents Saturday.
* @private
* @static
* @type {number}
*/
private static "__#9@#SATURDAY";
/**
* Get the numerical representation for Sunday.
* @returns {number} The value for Sunday (0).
*/
static get SUNDAY(): number;
/**
* Get the numerical representation for Monday.
* @returns {number} The value for Monday (1).
*/
static get MONDAY(): number;
/**
* Get the numerical representation for Tuesday.
* @returns {number} The value for Tuesday (2).
*/
static get TUESDAY(): number;
/**
* Get the numerical representation for Wednesday.
* @returns {number} The value for Wednesday (3).
*/
static get WEDNESDAY(): number;
/**
* Get the numerical representation for Thursday.
* @returns {number} The value for Thursday (4).
*/
static get THURSDAY(): number;
/**
* Get the numerical representation for Friday.
* @returns {number} The value for Friday (5).
*/
static get FRIDAY(): number;
/**
* Get the numerical representation for Saturday.
* @returns {number} The value for Saturday (6).
*/
static get SATURDAY(): number;
}