UNPKG

@barchart/common-js

Version:
80 lines (79 loc) 2.13 kB
/** * Describes for a day can be formatted. * * @public * @extends {Enum} */ export default class DayFormatType extends Enum { /** * Specifies date formatting as four-digit year, then month, then day (e.g. 2025-11-31). * * @public * @static * @returns {DayFormatType} */ public static get YYYY_MM_DD(): DayFormatType; /** * Specifies date formatting as month, then day, then four-digit year (e.g. 11-31-2025). * * @public * @static * @returns {DayFormatType} */ public static get MM_DD_YYYY(): DayFormatType; /** * Specifies date formatting as month, then day, then two-digit year (e.g. 11-31-25). * * @public * @static * @returns {DayFormatType} */ public static get MM_DD_YY(): DayFormatType; /** * @param {string} description * @param {RegExp} regex * @param {number} yearIndex * @param {number} monthIndex * @param {number} dayIndex * @param {number} yearShift */ constructor(description: string, regex: RegExp, yearIndex: number, monthIndex: number, dayIndex: number, yearShift: number); /** * A regular expression for parsing the day type. * * @public * @returns {RegExp} */ public get regex(): RegExp; /** * The index used to read the year from a regular expression match. * * @public * @returns {number} */ public get yearIndex(): number; /** * The index used to read the month from a regular expression match. * * @public * @returns {number} */ public get monthIndex(): number; /** * The index used to read the day from a regular expression match. * * @public * @returns {number} */ public get dayIndex(): number; /** * The amount to add to the year (extracted from a formatted string) to get the * full year (e.g. for "11-31-25" of an MM-DD-YY string, the value will be 2000). * * @public * @returns {number} */ public get yearShift(): number; #private; } import Enum from './Enum.js';