timezonecomplete
Version:
DateTime, TimeZone, Duration and Period library aimed at providing a consistent and complete date-time interface, away from the original JavaScript Date class.
52 lines (51 loc) • 972 B
TypeScript
/**
* Functionality to parse a DateTime object to a string
*/
/**
* Different types of tokens, each for a DateTime "period type" (like year, month, hour etc.)
*/
export declare enum TokenType {
/**
* Raw text
*/
IDENTITY = 0,
ERA = 1,
YEAR = 2,
QUARTER = 3,
MONTH = 4,
WEEK = 5,
DAY = 6,
WEEKDAY = 7,
DAYPERIOD = 8,
HOUR = 9,
MINUTE = 10,
SECOND = 11,
ZONE = 12
}
/**
* Basic token
*/
export interface Token {
/**
* The type of token
*/
type: TokenType;
/**
* The symbol from which the token was parsed
*/
symbol: string;
/**
* The total length of the token
*/
length: number;
/**
* The original string that produced this token
*/
raw: string;
}
/**
* Tokenize an LDML date/time format string
* @param formatString the string to tokenize
* @throws nothing
*/
export declare function tokenize(formatString: string): Token[];