Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(ci: CultureInfo) {
super(ci);
this.internalNumberExtractor = new EnglishNumberExtractor(NumberMode.Default);
this.internalNumberParser = AgnosticNumberParserFactory.getParser(AgnosticNumberParserType.Number, new EnglishNumberParserConfiguration());
this.connectorToken = '';
this.currencyNameToIsoCodeMap = EnglishNumericWithUnit.CurrencyNameToIsoCodeMap;
this.currencyFractionCodeList = EnglishNumericWithUnit.FractionalUnitNameToCodeMap;
}
}
constructor(dmyDateFormat: boolean = false) {
super();
this.utilityConfiguration = new EnglishDateTimeUtilityConfiguration();
this.unitMap = EnglishDateTime.UnitMap;
this.unitValueMap = EnglishDateTime.UnitValueMap;
this.seasonMap = EnglishDateTime.SeasonMap;
this.cardinalMap = EnglishDateTime.CardinalMap;
this.dayOfWeek = EnglishDateTime.DayOfWeek;
this.monthOfYear = EnglishDateTime.MonthOfYear;
this.numbers = EnglishDateTime.Numbers;
this.doubleNumbers = EnglishDateTime.DoubleNumbers;
this.cardinalExtractor = new EnglishCardinalExtractor();
this.integerExtractor = new EnglishIntegerExtractor();
this.ordinalExtractor = new EnglishOrdinalExtractor();
this.dayOfMonth = new Map([...BaseDateTime.DayOfMonthDictionary, ...EnglishDateTime.DayOfMonth]);
this.numberParser = new BaseNumberParser(new EnglishNumberParserConfiguration());
this.dateExtractor = new BaseDateExtractor(new EnglishDateExtractorConfiguration(dmyDateFormat));
this.timeExtractor = new BaseTimeExtractor(new EnglishTimeExtractorConfiguration());
this.dateTimeExtractor = new BaseDateTimeExtractor(new EnglishDateTimeExtractorConfiguration(dmyDateFormat));
this.durationExtractor = new BaseDurationExtractor(new EnglishDurationExtractorConfiguration());
this.datePeriodExtractor = new BaseDatePeriodExtractor(new EnglishDatePeriodExtractorConfiguration(dmyDateFormat));
this.timePeriodExtractor = new BaseTimePeriodExtractor(new EnglishTimePeriodExtractorConfiguration());
this.dateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new EnglishDateTimePeriodExtractorConfiguration(dmyDateFormat));
this.durationParser = new BaseDurationParser(new EnglishDurationParserConfiguration(this));
this.dateParser = new BaseDateParser(new EnglishDateParserConfiguration(this, dmyDateFormat));
this.timeParser = new EnglishTimeParser(new EnglishTimeParserConfiguration(this));
this.dateTimeParser = new BaseDateTimeParser(new EnglishDateTimeParserConfiguration(this));
this.datePeriodParser = new BaseDatePeriodParser(new EnglishDatePeriodParserConfiguration(this));
this.timePeriodParser = new BaseTimePeriodParser(new EnglishTimePeriodParserConfiguration(this));
this.dateTimePeriodParser = new BaseDateTimePeriodParser(new EnglishDateTimePeriodParserConfiguration(this));
}
}
];
this.illegalYearRegex = RegExpUtility.getSafeRegExp(BaseDateTime.IllegalYearRegex);
this.YearRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.YearRegex);
this.tillRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.TillRegex);
this.followedUnit = RegExpUtility.getSafeRegExp(EnglishDateTime.FollowedDateUnit);
this.numberCombinedWithUnit = RegExpUtility.getSafeRegExp(EnglishDateTime.NumberCombinedWithDateUnit);
this.pastRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.PreviousPrefixRegex);
this.futureRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.NextPrefixRegex);
this.weekOfRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.WeekOfRegex);
this.monthOfRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.MonthOfRegex);
this.dateUnitRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.DateUnitRegex);
this.inConnectorRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.InConnectorRegex);
this.rangeUnitRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.RangeUnitRegex);
this.datePointExtractor = new BaseDateExtractor(new EnglishDateExtractorConfiguration(dmyDateFormat));
this.integerExtractor = new EnglishIntegerExtractor();
this.numberParser = new BaseNumberParser(new EnglishNumberParserConfiguration());
this.durationExtractor = new BaseDurationExtractor(new EnglishDurationExtractorConfiguration());
this.rangeConnectorRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.RangeConnectorRegex);
this.nowRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.NowRegex);
}
RegExpUtility.getSafeRegExp(EnglishDateTime.WeekDayOfMonthRegex),
RegExpUtility.getSafeRegExp(EnglishDateTime.SpecialDate),
RegExpUtility.getSafeRegExp(EnglishDateTime.RelativeWeekDayRegex),
];
this.monthEnd = RegExpUtility.getSafeRegExp(EnglishDateTime.MonthEnd);
this.ofMonth = RegExpUtility.getSafeRegExp(EnglishDateTime.OfMonth);
this.dateUnitRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.DateUnitRegex);
this.forTheRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.ForTheRegex);
this.weekDayAndDayOfMonthRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.WeekDayAndDayOfMonthRegex);
this.relativeMonthRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.RelativeMonthRegex);
this.strictRelativeRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.StrictRelativeRegex);
this.weekDayRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.WeekDayRegex);
this.dayOfWeek = EnglishDateTime.DayOfWeek;
this.ordinalExtractor = new EnglishOrdinalExtractor();
this.integerExtractor = new EnglishIntegerExtractor();
this.numberParser = new BaseNumberParser(new EnglishNumberParserConfiguration());
this.durationExtractor = new BaseDurationExtractor(new EnglishDurationExtractorConfiguration());
this.utilityConfiguration = new EnglishDateTimeUtilityConfiguration();
}
}