chrono-node
- Version 2.7.7
- Published
- 2.67 MB
- 1 dependency
- MIT license
Install
npm i chrono-node
yarn add chrono-node
pnpm add chrono-node
Overview
A natural language date parser in Javascript
Index
Variables
Functions
Classes
Interfaces
Enums
Type Aliases
Namespaces
Variables
Functions
Classes
class Chrono
class Chrono {}
constructor
constructor(configuration?: Configuration);
property defaultConfig
defaultConfig: ENDefaultConfiguration;
property parsers
parsers: Parser[];
property refiners
refiners: Refiner[];
method clone
clone: () => Chrono;
method parse
parse: ( text: string, referenceDate?: ParsingReference | Date, option?: ParsingOption) => ParsedResult[];
method parseDate
parseDate: ( text: string, referenceDate?: ParsingReference | Date, option?: ParsingOption) => Date | null;
class ParsingComponents
class ParsingComponents implements ParsedComponents {}
constructor
constructor( reference: ReferenceWithTimezone, knownComponents?: { year?: number; month?: number; day?: number; weekday?: number; hour?: number; minute?: number; second?: number; millisecond?: number; meridiem?: number; timezoneOffset?: number; });
method addTag
addTag: (tag: string) => ParsingComponents;
method addTags
addTags: (tags: string[] | Set<string>) => ParsingComponents;
method assign
assign: (component: Component, value: number) => ParsingComponents;
method clone
clone: () => ParsingComponents;
method createRelativeFromReference
static createRelativeFromReference: ( reference: ReferenceWithTimezone, fragments: { [x: string]: number }) => ParsingComponents;
method date
date: () => Date;
method dayjs
dayjs: () => dayjs.Dayjs;
method delete
delete: (component: Component) => void;
method get
get: (component: Component) => number | null;
method getCertainComponents
getCertainComponents: () => Array<Component>;
method imply
imply: (component: Component, value: number) => ParsingComponents;
method isCertain
isCertain: (component: Component) => boolean;
method isDateWithUnknownYear
isDateWithUnknownYear: () => boolean;
method isOnlyDate
isOnlyDate: () => boolean;
method isOnlyTime
isOnlyTime: () => boolean;
method isOnlyWeekdayComponent
isOnlyWeekdayComponent: () => boolean;
method isValidDate
isValidDate: () => boolean;
method tags
tags: () => Set<string>;
method toString
toString: () => string;
class ParsingResult
class ParsingResult implements ParsedResult {}
constructor
constructor( reference: ReferenceWithTimezone, index: number, text: string, start?: ParsingComponents, end?: ParsingComponents);
property end
end?: ParsingComponents;
property index
index: number;
property refDate
refDate: Date;
property reference
reference: ReferenceWithTimezone;
property start
start: ParsingComponents;
property text
text: string;
method clone
clone: () => ParsingResult;
method date
date: () => Date;
method tags
tags: () => Set<string>;
method toString
toString: () => string;
class ReferenceWithTimezone
class ReferenceWithTimezone {}
constructor
constructor(input?: ParsingReference | Date);
property instant
readonly instant: Date;
property timezoneOffset
readonly timezoneOffset?: number;
method getDateWithAdjustedTimezone
getDateWithAdjustedTimezone: () => Date;
method getSystemTimezoneAdjustmentMinute
getSystemTimezoneAdjustmentMinute: ( date?: Date, overrideTimezoneOffset?: number) => number;
Interfaces
interface ParsedComponents
interface ParsedComponents {}
interface ParsedResult
interface ParsedResult {}
interface Parser
interface Parser {}
method extract
extract: ( context: ParsingContext, match: RegExpMatchArray) => | ParsingComponents | ParsingResult | { year?: number; month?: number; day?: number; weekday?: number; hour?: number; minute?: number; second?: number; millisecond?: number; meridiem?: number; timezoneOffset?: number; };
method pattern
pattern: (context: ParsingContext) => RegExp;
interface ParsingOption
interface ParsingOption {}
property forwardDate
forwardDate?: boolean;
property timezones
timezones?: TimezoneAbbrMap;
interface ParsingReference
interface ParsingReference {}
Enums
Type Aliases
type Component
type Component = | 'year' | 'month' | 'day' | 'weekday' | 'hour' | 'minute' | 'second' | 'millisecond' | 'meridiem' | 'timezoneOffset';
Namespaces
namespace de
module 'dist/esm/locales/de/index.d.ts' {}
variable casual
const casual: Chrono;
variable strict
const strict: Chrono;
function createCasualConfiguration
createCasualConfiguration: (littleEndian?: boolean) => Configuration;
function createConfiguration
createConfiguration: ( strictMode?: boolean, littleEndian?: boolean) => Configuration;
function parse
parse: ( text: string, ref?: ParsingReference | Date, option?: ParsingOption) => ParsedResult[];
function parseDate
parseDate: ( text: string, ref?: ParsingReference | Date, option?: ParsingOption) => Date;
class Chrono
class Chrono {}
constructor
constructor(configuration?: Configuration);
property defaultConfig
defaultConfig: ENDefaultConfiguration;
property parsers
parsers: Parser[];
property refiners
refiners: Refiner[];
method clone
clone: () => Chrono;
method parse
parse: ( text: string, referenceDate?: ParsingReference | Date, option?: ParsingOption) => ParsedResult[];
method parseDate
parseDate: ( text: string, referenceDate?: ParsingReference | Date, option?: ParsingOption) => Date | null;
class ParsingComponents
class ParsingComponents implements ParsedComponents {}
constructor
constructor( reference: ReferenceWithTimezone, knownComponents?: { year?: number; month?: number; day?: number; weekday?: number; hour?: number; minute?: number; second?: number; millisecond?: number; meridiem?: number; timezoneOffset?: number; });
method addTag
addTag: (tag: string) => ParsingComponents;
method addTags
addTags: (tags: string[] | Set<string>) => ParsingComponents;
method assign
assign: (component: Component, value: number) => ParsingComponents;
method clone
clone: () => ParsingComponents;
method createRelativeFromReference
static createRelativeFromReference: ( reference: ReferenceWithTimezone, fragments: { [x: string]: number }) => ParsingComponents;
method date
date: () => Date;
method dayjs
dayjs: () => dayjs.Dayjs;
method delete
delete: (component: Component) => void;
method get
get: (component: Component) => number | null;
method getCertainComponents
getCertainComponents: () => Array<Component>;
method imply
imply: (component: Component, value: number) => ParsingComponents;
method isCertain
isCertain: (component: Component) => boolean;
method isDateWithUnknownYear
isDateWithUnknownYear: () => boolean;
method isOnlyDate
isOnlyDate: () => boolean;
method isOnlyTime
isOnlyTime: () => boolean;
method isOnlyWeekdayComponent
isOnlyWeekdayComponent: () => boolean;
method isValidDate
isValidDate: () => boolean;
method tags
tags: () => Set<string>;
method toString
toString: () => string;
class ParsingResult
class ParsingResult implements ParsedResult {}
constructor
constructor( reference: ReferenceWithTimezone, index: number, text: string, start?: ParsingComponents, end?: ParsingComponents);
property end
end?: ParsingComponents;
property index
index: number;
property refDate
refDate: Date;
property reference
reference: ReferenceWithTimezone;
property start
start: ParsingComponents;
property text
text: string;
method clone
clone: () => ParsingResult;
method date
date: () => Date;
method tags
tags: () => Set<string>;
method toString
toString: () => string;
class ReferenceWithTimezone
class ReferenceWithTimezone {}
constructor
constructor(input?: ParsingReference | Date);
property instant
readonly instant: Date;
property timezoneOffset
readonly timezoneOffset?: number;
method getDateWithAdjustedTimezone
getDateWithAdjustedTimezone: () => Date;
method getSystemTimezoneAdjustmentMinute
getSystemTimezoneAdjustmentMinute: ( date?: Date, overrideTimezoneOffset?: number) => number;
interface ParsedResult
interface ParsedResult {}
interface Parser
interface Parser {}
method extract
extract: ( context: ParsingContext, match: RegExpMatchArray) => | ParsingComponents | ParsingResult | { year?: number; month?: number; day?: number; weekday?: number; hour?: number; minute?: number; second?: number; millisecond?: number; meridiem?: number; timezoneOffset?: number; };
method pattern
pattern: (context: ParsingContext) => RegExp;
interface ParsingOption
interface ParsingOption {}
property forwardDate
forwardDate?: boolean;
property timezones
timezones?: TimezoneAbbrMap;
interface ParsingReference
interface ParsingReference {}
interface Refiner
interface Refiner {}
property refine
refine: (context: ParsingContext, results: ParsingResult[]) => ParsingResult[];
enum Weekday
enum Weekday { SUNDAY = 0, MONDAY = 1, TUESDAY = 2, WEDNESDAY = 3, THURSDAY = 4, FRIDAY = 5, SATURDAY = 6,}
type Component
type Component = | 'year' | 'month' | 'day' | 'weekday' | 'hour' | 'minute' | 'second' | 'millisecond' | 'meridiem' | 'timezoneOffset';
namespace en
module 'dist/esm/locales/en/index.d.ts' {}
variable casual
const casual: Chrono;
variable configuration
const configuration: ENDefaultConfiguration;
variable GB
const GB: Chrono;
variable strict
const strict: Chrono;
function parse
parse: ( text: string, ref?: ParsingReference | Date, option?: ParsingOption) => ParsedResult[];
function parseDate
parseDate: ( text: string, ref?: ParsingReference | Date, option?: ParsingOption) => Date;
class Chrono
class Chrono {}
constructor
constructor(configuration?: Configuration);
property defaultConfig
defaultConfig: ENDefaultConfiguration;
property parsers
parsers: Parser[];
property refiners
refiners: Refiner[];
method clone
clone: () => Chrono;
method parse
parse: ( text: string, referenceDate?: ParsingReference | Date, option?: ParsingOption) => ParsedResult[];
method parseDate
parseDate: ( text: string, referenceDate?: ParsingReference | Date, option?: ParsingOption) => Date | null;
class ParsingComponents
class ParsingComponents implements ParsedComponents {}
constructor
constructor( reference: ReferenceWithTimezone, knownComponents?: { year?: number; month?: number; day?: number; weekday?: number; hour?: number; minute?: number; second?: number; millisecond?: number; meridiem?: number; timezoneOffset?: number; });
method addTag
addTag: (tag: string) => ParsingComponents;
method addTags
addTags: (tags: string[] | Set<string>) => ParsingComponents;
method assign
assign: (component: Component, value: number) => ParsingComponents;
method clone
clone: () => ParsingComponents;
method createRelativeFromReference
static createRelativeFromReference: ( reference: ReferenceWithTimezone, fragments: { [x: string]: number }) => ParsingComponents;
method date
date: () => Date;
method dayjs
dayjs: () => dayjs.Dayjs;
method delete
delete: (component: Component) => void;
method get
get: (component: Component) => number | null;
method getCertainComponents
getCertainComponents: () => Array<Component>;
method imply
imply: (component: Component, value: number) => ParsingComponents;
method isCertain
isCertain: (component: Component) => boolean;
method isDateWithUnknownYear
isDateWithUnknownYear: () => boolean;
method isOnlyDate
isOnlyDate: () => boolean;
method isOnlyTime
isOnlyTime: () => boolean;
method isOnlyWeekdayComponent
isOnlyWeekdayComponent: () => boolean;
method isValidDate
isValidDate: () => boolean;
method tags
tags: () => Set<string>;
method toString
toString: () => string;
class ParsingResult
class ParsingResult implements ParsedResult {}
constructor
constructor( reference: ReferenceWithTimezone, index: number, text: string, start?: ParsingComponents, end?: ParsingComponents);
property end
end?: ParsingComponents;
property index
index: number;
property refDate
refDate: Date;
property reference
reference: ReferenceWithTimezone;
property start
start: ParsingComponents;
property text
text: string;
method clone
clone: () => ParsingResult;
method date
date: () => Date;
method tags
tags: () => Set<string>;
method toString
toString: () => string;
class ReferenceWithTimezone
class ReferenceWithTimezone {}
constructor
constructor(input?: ParsingReference | Date);
property instant
readonly instant: Date;
property timezoneOffset
readonly timezoneOffset?: number;
method getDateWithAdjustedTimezone
getDateWithAdjustedTimezone: () => Date;
method getSystemTimezoneAdjustmentMinute
getSystemTimezoneAdjustmentMinute: ( date?: Date, overrideTimezoneOffset?: number) => number;
interface ParsedResult
interface ParsedResult {}
interface Parser
interface Parser {}
method extract
extract: ( context: ParsingContext, match: RegExpMatchArray) => | ParsingComponents | ParsingResult | { year?: number; month?: number; day?: number; weekday?: number; hour?: number; minute?: number; second?: number; millisecond?: number; meridiem?: number; timezoneOffset?: number; };
method pattern
pattern: (context: ParsingContext) => RegExp;
interface ParsingOption
interface ParsingOption {}
property forwardDate
forwardDate?: boolean;
property timezones
timezones?: TimezoneAbbrMap;
interface ParsingReference
interface ParsingReference {}
interface Refiner
interface Refiner {}
property refine
refine: (context: ParsingContext, results: ParsingResult[]) => ParsingResult[];
enum Weekday
enum Weekday { SUNDAY = 0, MONDAY = 1, TUESDAY = 2, WEDNESDAY = 3, THURSDAY = 4, FRIDAY = 5, SATURDAY = 6,}
type Component
type Component = | 'year' | 'month' | 'day' | 'weekday' | 'hour' | 'minute' | 'second' | 'millisecond' | 'meridiem' | 'timezoneOffset';
namespace es
module 'dist/esm/locales/es/index.d.ts' {}
variable casual
const casual: Chrono;
variable strict
const strict: Chrono;
function createCasualConfiguration
createCasualConfiguration: (littleEndian?: boolean) => Configuration;
function createConfiguration
createConfiguration: ( strictMode?: boolean, littleEndian?: boolean) => Configuration;
function parse
parse: ( text: string, ref?: ParsingReference | Date, option?: ParsingOption) => ParsedResult[];
function parseDate
parseDate: ( text: string, ref?: ParsingReference | Date, option?: ParsingOption) => Date;
class Chrono
class Chrono {}
constructor
constructor(configuration?: Configuration);
property defaultConfig
defaultConfig: ENDefaultConfiguration;
property parsers
parsers: Parser[];
property refiners
refiners: Refiner[];
method clone
clone: () => Chrono;
method parse
parse: ( text: string, referenceDate?: ParsingReference | Date, option?: ParsingOption) => ParsedResult[];
method parseDate
parseDate: ( text: string, referenceDate?: ParsingReference | Date, option?: ParsingOption) => Date | null;
class ParsingComponents
class ParsingComponents implements ParsedComponents {}
constructor
constructor( reference: ReferenceWithTimezone, knownComponents?: { year?: number; month?: number; day?: number; weekday?: number; hour?: number; minute?: number; second?: number; millisecond?: number; meridiem?: number; timezoneOffset?: number; });
method addTag
addTag: (tag: string) => ParsingComponents;
method addTags
addTags: (tags: string[] | Set<string>) => ParsingComponents;
method assign
assign: (component: Component, value: number) => ParsingComponents;
method clone
clone: () => ParsingComponents;
method createRelativeFromReference
static createRelativeFromReference: ( reference: ReferenceWithTimezone, fragments: { [x: string]: number }) => ParsingComponents;
method date
date: () => Date;
method dayjs
dayjs: () => dayjs.Dayjs;
method delete
delete: (component: Component) => void;
method get
get: (component: Component) => number | null;
method getCertainComponents
getCertainComponents: () => Array<Component>;
method imply
imply: (component: Component, value: number) => ParsingComponents;
method isCertain
isCertain: (component: Component) => boolean;
method isDateWithUnknownYear
isDateWithUnknownYear: () => boolean;
method isOnlyDate
isOnlyDate: () => boolean;
method isOnlyTime
isOnlyTime: () => boolean;
method isOnlyWeekdayComponent
isOnlyWeekdayComponent: () => boolean;
method isValidDate
isValidDate: () => boolean;
method tags
tags: () => Set<string>;
method toString
toString: () => string;
class ParsingResult
class ParsingResult implements ParsedResult {}
constructor
constructor( reference: ReferenceWithTimezone, index: number, text: string, start?: ParsingComponents, end?: ParsingComponents);
property end
end?: ParsingComponents;
property index
index: number;
property refDate
refDate: Date;
property reference
reference: ReferenceWithTimezone;
property start
start: ParsingComponents;
property text
text: string;
method clone
clone: () => ParsingResult;
method date
date: () => Date;
method tags
tags: () => Set<string>;
method toString
toString: () => string;
class ReferenceWithTimezone
class ReferenceWithTimezone {}
constructor
constructor(input?: ParsingReference | Date);
property instant
readonly instant: Date;
property timezoneOffset
readonly timezoneOffset?: number;
method getDateWithAdjustedTimezone
getDateWithAdjustedTimezone: () => Date;
method getSystemTimezoneAdjustmentMinute
getSystemTimezoneAdjustmentMinute: ( date?: Date, overrideTimezoneOffset?: number) => number;
interface ParsedResult
interface ParsedResult {}
interface Parser
interface Parser {}
method extract
extract: ( context: ParsingContext, match: RegExpMatchArray) => | ParsingComponents | ParsingResult | { year?: number; month?: number; day?: number; weekday?: number; hour?: number; minute?: number; second?: number; millisecond?: number; meridiem?: number; timezoneOffset?: number; };
method pattern
pattern: (context: ParsingContext) => RegExp;
interface ParsingOption
interface ParsingOption {}
property forwardDate
forwardDate?: boolean;
property timezones
timezones?: TimezoneAbbrMap;
interface ParsingReference
interface ParsingReference {}
interface Refiner
interface Refiner {}
property refine
refine: (context: ParsingContext, results: ParsingResult[]) => ParsingResult[];
enum Weekday
enum Weekday { SUNDAY = 0, MONDAY = 1, TUESDAY = 2, WEDNESDAY = 3, THURSDAY = 4, FRIDAY = 5, SATURDAY = 6,}
type Component
type Component = | 'year' | 'month' | 'day' | 'weekday' | 'hour' | 'minute' | 'second' | 'millisecond' | 'meridiem' | 'timezoneOffset';
namespace fr
module 'dist/esm/locales/fr/index.d.ts' {}
variable casual
const casual: Chrono;
variable strict
const strict: Chrono;
function createCasualConfiguration
createCasualConfiguration: (littleEndian?: boolean) => Configuration;
function createConfiguration
createConfiguration: ( strictMode?: boolean, littleEndian?: boolean) => Configuration;
function parse
parse: ( text: string, ref?: ParsingReference | Date, option?: ParsingOption) => ParsedResult[];
function parseDate
parseDate: ( text: string, ref?: ParsingReference | Date, option?: ParsingOption) => Date;
class Chrono
class Chrono {}
constructor
constructor(configuration?: Configuration);
property defaultConfig
defaultConfig: ENDefaultConfiguration;
property parsers
parsers: Parser[];
property refiners
refiners: Refiner[];
method clone
clone: () => Chrono;
method parse
parse: ( text: string, referenceDate?: ParsingReference | Date, option?: ParsingOption) => ParsedResult[];
method parseDate
parseDate: ( text: string, referenceDate?: ParsingReference | Date, option?: ParsingOption) => Date | null;
class ParsingComponents
class ParsingComponents implements ParsedComponents {}
constructor
constructor( reference: ReferenceWithTimezone, knownComponents?: { year?: number; month?: number; day?: number; weekday?: number; hour?: number; minute?: number; second?: number; millisecond?: number; meridiem?: number; timezoneOffset?: number; });
method addTag
addTag: (tag: string) => ParsingComponents;
method addTags
addTags: (tags: string[] | Set<string>) => ParsingComponents;
method assign
assign: (component: Component, value: number) => ParsingComponents;
method clone
clone: () => ParsingComponents;
method createRelativeFromReference
static createRelativeFromReference: ( reference: ReferenceWithTimezone, fragments: { [x: string]: number }) => ParsingComponents;
method date
date: () => Date;
method dayjs
dayjs: () => dayjs.Dayjs;
method delete
delete: (component: Component) => void;
method get
get: (component: Component) => number | null;
method getCertainComponents
getCertainComponents: () => Array<Component>;
method imply
imply: (component: Component, value: number) => ParsingComponents;
method isCertain
isCertain: (component: Component) => boolean;
method isDateWithUnknownYear
isDateWithUnknownYear: () => boolean;
method isOnlyDate
isOnlyDate: () => boolean;
method isOnlyTime
isOnlyTime: () => boolean;
method isOnlyWeekdayComponent
isOnlyWeekdayComponent: () => boolean;
method isValidDate
isValidDate: () => boolean;
method tags
tags: () => Set<string>;
method toString
toString: () => string;
class ParsingResult
class ParsingResult implements ParsedResult {}
constructor
constructor( reference: ReferenceWithTimezone, index: number, text: string, start?: ParsingComponents, end?: ParsingComponents);
property end
end?: ParsingComponents;
property index
index: number;
property refDate
refDate: Date;
property reference
reference: ReferenceWithTimezone;
property start
start: ParsingComponents;
property text
text: string;
method clone
clone: () => ParsingResult;
method date
date: () => Date;
method tags
tags: () => Set<string>;
method toString
toString: () => string;
class ReferenceWithTimezone
class ReferenceWithTimezone {}
constructor
constructor(input?: ParsingReference | Date);
property instant
readonly instant: Date;
property timezoneOffset
readonly timezoneOffset?: number;
method getDateWithAdjustedTimezone
getDateWithAdjustedTimezone: () => Date;
method getSystemTimezoneAdjustmentMinute
getSystemTimezoneAdjustmentMinute: ( date?: Date, overrideTimezoneOffset?: number) => number;
interface ParsedResult
interface ParsedResult {}
interface Parser
interface Parser {}
method extract
extract: ( context: ParsingContext, match: RegExpMatchArray) => | ParsingComponents | ParsingResult | { year?: number; month?: number; day?: number; weekday?: number; hour?: number; minute?: number; second?: number; millisecond?: number; meridiem?: number; timezoneOffset?: number; };
method pattern
pattern: (context: ParsingContext) => RegExp;
interface ParsingOption
interface ParsingOption {}
property forwardDate
forwardDate?: boolean;
property timezones
timezones?: TimezoneAbbrMap;
interface ParsingReference
interface ParsingReference {}
interface Refiner
interface Refiner {}
property refine
refine: (context: ParsingContext, results: ParsingResult[]) => ParsingResult[];
enum Weekday
enum Weekday { SUNDAY = 0, MONDAY = 1, TUESDAY = 2, WEDNESDAY = 3, THURSDAY = 4, FRIDAY = 5, SATURDAY = 6,}
type Component
type Component = | 'year' | 'month' | 'day' | 'weekday' | 'hour' | 'minute' | 'second' | 'millisecond' | 'meridiem' | 'timezoneOffset';
namespace ja
module 'dist/esm/locales/ja/index.d.ts' {}
variable casual
const casual: Chrono;
variable strict
const strict: Chrono;
function createCasualConfiguration
createCasualConfiguration: () => Configuration;
function createConfiguration
createConfiguration: () => Configuration;
function parse
parse: ( text: string, ref?: ParsingReference | Date, option?: ParsingOption) => ParsedResult[];
function parseDate
parseDate: ( text: string, ref?: ParsingReference | Date, option?: ParsingOption) => Date;
class Chrono
class Chrono {}
constructor
constructor(configuration?: Configuration);
property defaultConfig
defaultConfig: ENDefaultConfiguration;
property parsers
parsers: Parser[];
property refiners
refiners: Refiner[];
method clone
clone: () => Chrono;
method parse
parse: ( text: string, referenceDate?: ParsingReference | Date, option?: ParsingOption) => ParsedResult[];
method parseDate
parseDate: ( text: string, referenceDate?: ParsingReference | Date, option?: ParsingOption) => Date | null;
class ParsingComponents
class ParsingComponents implements ParsedComponents {}
constructor
constructor( reference: ReferenceWithTimezone, knownComponents?: { year?: number; month?: number; day?: number; weekday?: number; hour?: number; minute?: number; second?: number; millisecond?: number; meridiem?: number; timezoneOffset?: number; });
method addTag
addTag: (tag: string) => ParsingComponents;
method addTags
addTags: (tags: string[] | Set<string>) => ParsingComponents;
method assign
assign: (component: Component, value: number) => ParsingComponents;
method clone
clone: () => ParsingComponents;
method createRelativeFromReference
static createRelativeFromReference: ( reference: ReferenceWithTimezone, fragments: { [x: string]: number }) => ParsingComponents;
method date
date: () => Date;
method dayjs
dayjs: () => dayjs.Dayjs;
method delete
delete: (component: Component) => void;
method get
get: (component: Component) => number | null;
method getCertainComponents
getCertainComponents: () => Array<Component>;
method imply
imply: (component: Component, value: number) => ParsingComponents;
method isCertain
isCertain: (component: Component) => boolean;
method isDateWithUnknownYear
isDateWithUnknownYear: () => boolean;
method isOnlyDate
isOnlyDate: () => boolean;
method isOnlyTime
isOnlyTime: () => boolean;
method isOnlyWeekdayComponent
isOnlyWeekdayComponent: () => boolean;
method isValidDate
isValidDate: () => boolean;
method tags
tags: () => Set<string>;
method toString
toString: () => string;
class ParsingResult
class ParsingResult implements ParsedResult {}
constructor
constructor( reference: ReferenceWithTimezone, index: number, text: string, start?: ParsingComponents, end?: ParsingComponents);
property end
end?: ParsingComponents;
property index
index: number;
property refDate
refDate: Date;
property reference
reference: ReferenceWithTimezone;
property start
start: ParsingComponents;
property text
text: string;
method clone
clone: () => ParsingResult;
method date
date: () => Date;
method tags
tags: () => Set<string>;
method toString
toString: () => string;
class ReferenceWithTimezone
class ReferenceWithTimezone {}
constructor
constructor(input?: ParsingReference | Date);
property instant
readonly instant: Date;
property timezoneOffset
readonly timezoneOffset?: number;
method getDateWithAdjustedTimezone
getDateWithAdjustedTimezone: () => Date;
method getSystemTimezoneAdjustmentMinute
getSystemTimezoneAdjustmentMinute: ( date?: Date, overrideTimezoneOffset?: number) => number;
interface ParsedResult
interface ParsedResult {}
interface Parser
interface Parser {}
method extract
extract: ( context: ParsingContext, match: RegExpMatchArray) => | ParsingComponents | ParsingResult | { year?: number; month?: number; day?: number; weekday?: number; hour?: number; minute?: number; second?: number; millisecond?: number; meridiem?: number; timezoneOffset?: number; };
method pattern
pattern: (context: ParsingContext) => RegExp;
interface ParsingOption
interface ParsingOption {}
property forwardDate
forwardDate?: boolean;
property timezones
timezones?: TimezoneAbbrMap;
interface ParsingReference
interface ParsingReference {}
interface Refiner
interface Refiner {}
property refine
refine: (context: ParsingContext, results: ParsingResult[]) => ParsingResult[];
enum Weekday
enum Weekday { SUNDAY = 0, MONDAY = 1, TUESDAY = 2, WEDNESDAY = 3, THURSDAY = 4, FRIDAY = 5, SATURDAY = 6,}
type Component
type Component = | 'year' | 'month' | 'day' | 'weekday' | 'hour' | 'minute' | 'second' | 'millisecond' | 'meridiem' | 'timezoneOffset';
namespace nl
module 'dist/esm/locales/nl/index.d.ts' {}
variable casual
const casual: Chrono;
variable strict
const strict: Chrono;
function createCasualConfiguration
createCasualConfiguration: (littleEndian?: boolean) => Configuration;
function createConfiguration
createConfiguration: ( strictMode?: boolean, littleEndian?: boolean) => Configuration;
function parse
parse: ( text: string, ref?: ParsingReference | Date, option?: ParsingOption) => ParsedResult[];
function parseDate
parseDate: ( text: string, ref?: ParsingReference | Date, option?: ParsingOption) => Date;
class Chrono
class Chrono {}
constructor
constructor(configuration?: Configuration);
property defaultConfig
defaultConfig: ENDefaultConfiguration;
property parsers
parsers: Parser[];
property refiners
refiners: Refiner[];
method clone
clone: () => Chrono;
method parse
parse: ( text: string, referenceDate?: ParsingReference | Date, option?: ParsingOption) => ParsedResult[];
method parseDate
parseDate: ( text: string, referenceDate?: ParsingReference | Date, option?: ParsingOption) => Date | null;
class ParsingComponents
class ParsingComponents implements ParsedComponents {}
constructor
constructor( reference: ReferenceWithTimezone, knownComponents?: { year?: number; month?: number; day?: number; weekday?: number; hour?: number; minute?: number; second?: number; millisecond?: number; meridiem?: number; timezoneOffset?: number; });
method addTag
addTag: (tag: string) => ParsingComponents;
method addTags
addTags: (tags: string[] | Set<string>) => ParsingComponents;
method assign
assign: (component: Component, value: number) => ParsingComponents;
method clone
clone: () => ParsingComponents;
method createRelativeFromReference
static createRelativeFromReference: ( reference: ReferenceWithTimezone, fragments: { [x: string]: number }) => ParsingComponents;
method date
date: () => Date;
method dayjs
dayjs: () => dayjs.Dayjs;
method delete
delete: (component: Component) => void;
method get
get: (component: Component) => number | null;
method getCertainComponents
getCertainComponents: () => Array<Component>;
method imply
imply: (component: Component, value: number) => ParsingComponents;
method isCertain
isCertain: (component: Component) => boolean;
method isDateWithUnknownYear
isDateWithUnknownYear: () => boolean;
method isOnlyDate
isOnlyDate: () => boolean;
method isOnlyTime
isOnlyTime: () => boolean;
method isOnlyWeekdayComponent
isOnlyWeekdayComponent: () => boolean;
method isValidDate
isValidDate: () => boolean;
method tags
tags: () => Set<string>;
method toString
toString: () => string;
class ParsingResult
class ParsingResult implements ParsedResult {}
constructor
constructor( reference: ReferenceWithTimezone, index: number, text: string, start?: ParsingComponents, end?: ParsingComponents);
property end
end?: ParsingComponents;
property index
index: number;
property refDate
refDate: Date;
property reference
reference: ReferenceWithTimezone;
property start
start: ParsingComponents;
property text
text: string;
method clone
clone: () => ParsingResult;
method date
date: () => Date;
method tags
tags: () => Set<string>;
method toString
toString: () => string;
class ReferenceWithTimezone
class ReferenceWithTimezone {}
constructor
constructor(input?: ParsingReference | Date);
property instant
readonly instant: Date;
property timezoneOffset
readonly timezoneOffset?: number;
method getDateWithAdjustedTimezone
getDateWithAdjustedTimezone: () => Date;
method getSystemTimezoneAdjustmentMinute
getSystemTimezoneAdjustmentMinute: ( date?: Date, overrideTimezoneOffset?: number) => number;
interface ParsedResult
interface ParsedResult {}
interface Parser
interface Parser {}
method extract
extract: ( context: ParsingContext, match: RegExpMatchArray) => | ParsingComponents | ParsingResult | { year?: number; month?: number; day?: number; weekday?: number; hour?: number; minute?: number; second?: number; millisecond?: number; meridiem?: number; timezoneOffset?: number; };
method pattern
pattern: (context: ParsingContext) => RegExp;
interface ParsingOption
interface ParsingOption {}
property forwardDate
forwardDate?: boolean;
property timezones
timezones?: TimezoneAbbrMap;
interface ParsingReference
interface ParsingReference {}
interface Refiner
interface Refiner {}
property refine
refine: (context: ParsingContext, results: ParsingResult[]) => ParsingResult[];
enum Weekday
enum Weekday { SUNDAY = 0, MONDAY = 1, TUESDAY = 2, WEDNESDAY = 3, THURSDAY = 4, FRIDAY = 5, SATURDAY = 6,}
type Component
type Component = | 'year' | 'month' | 'day' | 'weekday' | 'hour' | 'minute' | 'second' | 'millisecond' | 'meridiem' | 'timezoneOffset';
namespace pt
module 'dist/esm/locales/pt/index.d.ts' {}
variable casual
const casual: Chrono;
variable strict
const strict: Chrono;
function createCasualConfiguration
createCasualConfiguration: (littleEndian?: boolean) => Configuration;
function createConfiguration
createConfiguration: ( strictMode?: boolean, littleEndian?: boolean) => Configuration;
function parse
parse: ( text: string, ref?: ParsingReference | Date, option?: ParsingOption) => ParsedResult[];
function parseDate
parseDate: ( text: string, ref?: ParsingReference | Date, option?: ParsingOption) => Date;
class Chrono
class Chrono {}
constructor
constructor(configuration?: Configuration);
property defaultConfig
defaultConfig: ENDefaultConfiguration;
property parsers
parsers: Parser[];
property refiners
refiners: Refiner[];
method clone
clone: () => Chrono;
method parse
parse: ( text: string, referenceDate?: ParsingReference | Date, option?: ParsingOption) => ParsedResult[];
method parseDate
parseDate: ( text: string, referenceDate?: ParsingReference | Date, option?: ParsingOption) => Date | null;
class ParsingComponents
class ParsingComponents implements ParsedComponents {}
constructor
constructor( reference: ReferenceWithTimezone, knownComponents?: { year?: number; month?: number; day?: number; weekday?: number; hour?: number; minute?: number; second?: number; millisecond?: number; meridiem?: number; timezoneOffset?: number; });
method addTag
addTag: (tag: string) => ParsingComponents;
method addTags
addTags: (tags: string[] | Set<string>) => ParsingComponents;
method assign
assign: (component: Component, value: number) => ParsingComponents;
method clone
clone: () => ParsingComponents;
method createRelativeFromReference
static createRelativeFromReference: ( reference: ReferenceWithTimezone, fragments: { [x: string]: number }) => ParsingComponents;
method date
date: () => Date;
method dayjs
dayjs: () => dayjs.Dayjs;
method delete
delete: (component: Component) => void;
method get
get: (component: Component) => number | null;
method getCertainComponents
getCertainComponents: () => Array<Component>;
method imply
imply: (component: Component, value: number) => ParsingComponents;
method isCertain