Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(dmyDateFormat: boolean) {
let config = new ChineseDatePeriodParserConfiguration(dmyDateFormat);
super(config, false);
this.integerExtractor = new ChineseIntegerExtractor();
this.numberParser = AgnosticNumberParserFactory.getParser(AgnosticNumberParserType.Integer, new ChineseNumberParserConfiguration());
this.yearInChineseRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.DatePeriodYearInChineseRegex);
this.numberCombinedWithUnitRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.NumberCombinedWithUnit);
this.unitRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.UnitRegex);
this.yearAndMonthRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.YearAndMonth);
this.pureNumberYearAndMonthRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.PureNumYearAndMonth);
this.yearToYearRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.YearToYear);
this.YearToYearSuffixRequired = RegExpUtility.getSafeRegExp(ChineseDateTime.YearToYearSuffixRequired);
this.chineseYearRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.DatePeriodYearInChineseRegex);
this.seasonWithYearRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.SeasonWithYear);
}
constructor(dmyDateFormat: boolean) {
this.simpleCasesRegexes = [
RegExpUtility.getSafeRegExp(ChineseDateTime.SimpleCasesRegex),
RegExpUtility.getSafeRegExp(ChineseDateTime.OneWordPeriodRegex),
RegExpUtility.getSafeRegExp(ChineseDateTime.StrictYearRegex),
RegExpUtility.getSafeRegExp(ChineseDateTime.YearToYear),
RegExpUtility.getSafeRegExp(ChineseDateTime.YearToYearSuffixRequired),
RegExpUtility.getSafeRegExp(ChineseDateTime.YearAndMonth),
RegExpUtility.getSafeRegExp(ChineseDateTime.PureNumYearAndMonth),
RegExpUtility.getSafeRegExp(ChineseDateTime.DatePeriodYearInChineseRegex),
RegExpUtility.getSafeRegExp(ChineseDateTime.WeekOfMonthRegex),
RegExpUtility.getSafeRegExp(ChineseDateTime.SeasonWithYear),
RegExpUtility.getSafeRegExp(ChineseDateTime.QuarterRegex),
];
this.datePointExtractor = new ChineseDateExtractor(dmyDateFormat);
this.integerExtractor = new ChineseIntegerExtractor();
this.numberParser = new BaseNumberParser(new ChineseNumberParserConfiguration());
this.illegalYearRegex = RegExpUtility.getSafeRegExp(BaseDateTime.IllegalYearRegex);
this.tillRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.DatePeriodTillRegex);
this.followedUnit = RegExpUtility.getSafeRegExp(ChineseDateTime.FollowedUnit);
this.numberCombinedWithUnit = RegExpUtility.getSafeRegExp(ChineseDateTime.NumberCombinedWithUnit);
this.pastRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.PastRegex);
this.futureRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.FutureRegex);
this.nowRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.NowRegex);
}
constructor(dmyDateFormat: boolean) {
this.dateRegex = new ChineseDateExtractorConfiguration(dmyDateFormat).dateRegexList;
this.monthOfYear = ChineseDateTime.ParserConfigurationMonthOfYear;
this.dayOfMonth = ChineseDateTime.ParserConfigurationDayOfMonth;
this.dayOfWeek = ChineseDateTime.ParserConfigurationDayOfWeek;
this.specialDayRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.SpecialDayRegex);
this.specialDayWithNumRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.SpecialDayWithNumRegex);
this.thisRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.DateThisRegex);
this.nextRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.DateNextRegex);
this.lastRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.DateLastRegex);
this.unitRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.DateUnitRegex);
this.unitMap = ChineseDateTime.ParserConfigurationUnitMap;
this.weekDayRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.WeekDayRegex);
this.integerExtractor = new ChineseIntegerExtractor();
this.numberParser = AgnosticNumberParserFactory.getParser(AgnosticNumberParserType.Number, new ChineseNumberParserConfiguration());
}
}
constructor(dmyDateFormat: boolean) {
let config = new ChineseDateTimeParserConfiguration(dmyDateFormat);
super(config);
this.durationExtractor = new ChineseDurationExtractor();
this.integerExtractor = new ChineseIntegerExtractor();
}
constructor() {
let config = new ChineseHolidayParserConfiguration();
super(config);
this.lunarHolidayRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.LunarHolidayRegex);
this.integerExtractor = new ChineseIntegerExtractor();
this.numberParser = AgnosticNumberParserFactory.getParser(AgnosticNumberParserType.Integer, new ChineseNumberParserConfiguration());
this.fixedHolidayDictionary = new Map Date>([
['元旦', ChineseHolidayParser.NewYear],
['元旦节', ChineseHolidayParser.NewYear],
['教师节', ChineseHolidayParser.TeacherDay],
['青年节', ChineseHolidayParser.YouthDay],
['儿童节', ChineseHolidayParser.ChildrenDay],
['妇女节', ChineseHolidayParser.FemaleDay],
['植树节', ChineseHolidayParser.TreePlantDay],
['情人节', ChineseHolidayParser.LoverDay],
['平安夜', ChineseHolidayParser.ChristmasEve],
['圣诞节', ChineseHolidayParser.ChristmasDay],
['新年', ChineseHolidayParser.NewYear],
['愚人节', ChineseHolidayParser.FoolDay],
['五一', ChineseHolidayParser.LaborDay],
['劳动节', ChineseHolidayParser.LaborDay],