chrono-node 2.4.1 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/chrono.iml +13 -0
- package/.idea/compiler.xml +7 -0
- package/.idea/dictionaries/wanasit.xml +8 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/jsLibraryMappings.xml +6 -0
- package/.idea/jsLinters/eslint.xml +6 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/prettier.xml +6 -0
- package/.idea/vcs.xml +6 -0
- package/.idea/workspace.xml +327 -0
- package/README.md +1 -1
- package/benchmark/results/chrono.chart.html +111 -0
- package/coverage/clover.xml +4771 -0
- package/coverage/coverage-final.json +147 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +686 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/results.ts.html +701 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov-report/src/calculation/index.html +131 -0
- package/coverage/lcov-report/src/calculation/mergingCalculation.ts.html +319 -0
- package/coverage/lcov-report/src/calculation/weeks.ts.html +199 -0
- package/coverage/lcov-report/src/calculation/yearCalculation.ts.html +194 -0
- package/coverage/lcov-report/src/calculation/years.ts.html +199 -0
- package/coverage/lcov-report/src/chrono.js.html +368 -0
- package/coverage/lcov-report/src/chrono.ts.html +649 -0
- package/coverage/lcov-report/src/common/abstractRefiners.ts.html +286 -0
- package/coverage/lcov-report/src/common/calculation/index.html +116 -0
- package/coverage/lcov-report/src/common/calculation/weekdays.ts.html +352 -0
- package/coverage/lcov-report/src/common/casualReferences.ts.html +499 -0
- package/coverage/lcov-report/src/common/index.html +131 -0
- package/coverage/lcov-report/src/common/parsers/AbstractParserWithWordBoundary.ts.html +214 -0
- package/coverage/lcov-report/src/common/parsers/AbstractTimeExpressionParser.ts.html +1384 -0
- package/coverage/lcov-report/src/common/parsers/ISOFormatParser.ts.html +340 -0
- package/coverage/lcov-report/src/common/parsers/SlashDateFormatParser.ts.html +385 -0
- package/coverage/lcov-report/src/common/parsers/index.html +161 -0
- package/coverage/lcov-report/src/common/refiners/AbstractMergeDateRangeRefiner.ts.html +268 -0
- package/coverage/lcov-report/src/common/refiners/AbstractMergeDateTimeRefiner.ts.html +172 -0
- package/coverage/lcov-report/src/common/refiners/ExtractTimezoneAbbrRefiner.ts.html +883 -0
- package/coverage/lcov-report/src/common/refiners/ExtractTimezoneOffsetRefiner.ts.html +226 -0
- package/coverage/lcov-report/src/common/refiners/ForwardDateRefiner.ts.html +334 -0
- package/coverage/lcov-report/src/common/refiners/MergeWeekdayComponentRefiner.ts.html +187 -0
- package/coverage/lcov-report/src/common/refiners/OverlapRemovalRefiner.ts.html +199 -0
- package/coverage/lcov-report/src/common/refiners/UnlikelyFormatFilter.ts.html +265 -0
- package/coverage/lcov-report/src/common/refiners/index.html +221 -0
- package/coverage/lcov-report/src/configurations.ts.html +154 -0
- package/coverage/lcov-report/src/debugging.ts.html +154 -0
- package/coverage/lcov-report/src/index.html +191 -0
- package/coverage/lcov-report/src/index.ts.html +520 -0
- package/coverage/lcov-report/src/locales/de/constants.ts.html +664 -0
- package/coverage/lcov-report/src/locales/de/index.html +131 -0
- package/coverage/lcov-report/src/locales/de/index.ts.html +238 -0
- package/coverage/lcov-report/src/locales/de/parsers/DECasualDateParser.ts.html +325 -0
- package/coverage/lcov-report/src/locales/de/parsers/DECasualTimeParser.ts.html +325 -0
- package/coverage/lcov-report/src/locales/de/parsers/DEMonthNameLittleEndianParser.ts.html +268 -0
- package/coverage/lcov-report/src/locales/de/parsers/DESpecificTimeExpressionParser.ts.html +535 -0
- package/coverage/lcov-report/src/locales/de/parsers/DETimeExpressionParser.ts.html +151 -0
- package/coverage/lcov-report/src/locales/de/parsers/DETimeUnitRelativeFormatParser.ts.html +211 -0
- package/coverage/lcov-report/src/locales/de/parsers/DEWeekdayParser.ts.html +232 -0
- package/coverage/lcov-report/src/locales/de/parsers/index.html +206 -0
- package/coverage/lcov-report/src/locales/de/refiners/DEMergeDateRangeRefiner.ts.html +130 -0
- package/coverage/lcov-report/src/locales/de/refiners/DEMergeDateTimeRefiner.ts.html +115 -0
- package/coverage/lcov-report/src/locales/de/refiners/index.html +131 -0
- package/coverage/lcov-report/src/locales/en/constants.ts.html +859 -0
- package/coverage/lcov-report/src/locales/en/index.html +131 -0
- package/coverage/lcov-report/src/locales/en/index.ts.html +382 -0
- package/coverage/lcov-report/src/locales/en/parsers/ENCasualDateParser.ts.html +244 -0
- package/coverage/lcov-report/src/locales/en/parsers/ENCasualTimeParser.ts.html +169 -0
- package/coverage/lcov-report/src/locales/en/parsers/ENCasualYearMonthDayParser.ts.html +232 -0
- package/coverage/lcov-report/src/locales/en/parsers/ENDeadlineFormatParser.ts.html +311 -0
- package/coverage/lcov-report/src/locales/en/parsers/ENISOFormatParser.ts.html +317 -0
- package/coverage/lcov-report/src/locales/en/parsers/ENMonthNameLittleEndianParser.ts.html +292 -0
- package/coverage/lcov-report/src/locales/en/parsers/ENMonthNameMiddleEndianParser.ts.html +319 -0
- package/coverage/lcov-report/src/locales/en/parsers/ENMonthNameParser.ts.html +271 -0
- package/coverage/lcov-report/src/locales/en/parsers/ENRelativeDateFormatParser.ts.html +292 -0
- package/coverage/lcov-report/src/locales/en/parsers/ENSlashDateFormatParser.ts.html +443 -0
- package/coverage/lcov-report/src/locales/en/parsers/ENSlashDateFormatStartWithYearParser.ts.html +221 -0
- package/coverage/lcov-report/src/locales/en/parsers/ENSlashMonthFormatParser.ts.html +163 -0
- package/coverage/lcov-report/src/locales/en/parsers/ENTimeExpressionParser.ts.html +250 -0
- package/coverage/lcov-report/src/locales/en/parsers/ENTimeUnitAgoFormatParser.ts.html +160 -0
- package/coverage/lcov-report/src/locales/en/parsers/ENTimeUnitCasualRelativeFormatParser.ts.html +166 -0
- package/coverage/lcov-report/src/locales/en/parsers/ENTimeUnitDeadlineFormatParser.ts.html +149 -0
- package/coverage/lcov-report/src/locales/en/parsers/ENTimeUnitLaterFormatParser.ts.html +166 -0
- package/coverage/lcov-report/src/locales/en/parsers/ENTimeUnitWithinFormatParser.ts.html +163 -0
- package/coverage/lcov-report/src/locales/en/parsers/ENWeekdayParser.ts.html +229 -0
- package/coverage/lcov-report/src/locales/en/parsers/index.html +311 -0
- package/coverage/lcov-report/src/locales/en/refiners/ENMergeDateRangeRefiner.ts.html +136 -0
- package/coverage/lcov-report/src/locales/en/refiners/ENMergeDateTimeRefiner.ts.html +124 -0
- package/coverage/lcov-report/src/locales/en/refiners/ENMergeRelativeDateRefiner.ts.html +259 -0
- package/coverage/lcov-report/src/locales/en/refiners/index.html +146 -0
- package/coverage/lcov-report/src/locales/es/constants.ts.html +340 -0
- package/coverage/lcov-report/src/locales/es/index.html +131 -0
- package/coverage/lcov-report/src/locales/es/index.ts.html +256 -0
- package/coverage/lcov-report/src/locales/es/parsers/ESCasualDateParser.ts.html +178 -0
- package/coverage/lcov-report/src/locales/es/parsers/ESCasualTimeParser.ts.html +226 -0
- package/coverage/lcov-report/src/locales/es/parsers/ESMonthNameLittleEndianParser.ts.html +265 -0
- package/coverage/lcov-report/src/locales/es/parsers/ESTimeExpressionParser.ts.html +145 -0
- package/coverage/lcov-report/src/locales/es/parsers/ESWeekdayParser.ts.html +235 -0
- package/coverage/lcov-report/src/locales/es/parsers/index.html +176 -0
- package/coverage/lcov-report/src/locales/es/refiners/ESMergeDateRangeRefiner.ts.html +130 -0
- package/coverage/lcov-report/src/locales/es/refiners/ESMergeDateTimeRefiner.ts.html +115 -0
- package/coverage/lcov-report/src/locales/es/refiners/index.html +131 -0
- package/coverage/lcov-report/src/locales/fr/constants.ts.html +637 -0
- package/coverage/lcov-report/src/locales/fr/index.html +131 -0
- package/coverage/lcov-report/src/locales/fr/index.ts.html +280 -0
- package/coverage/lcov-report/src/locales/fr/parsers/FRCasualDateParser.ts.html +223 -0
- package/coverage/lcov-report/src/locales/fr/parsers/FRCasualTimeParser.ts.html +232 -0
- package/coverage/lcov-report/src/locales/fr/parsers/FRMonthNameLittleEndianParser.ts.html +277 -0
- package/coverage/lcov-report/src/locales/fr/parsers/FRSpecificTimeExpressionParser.ts.html +484 -0
- package/coverage/lcov-report/src/locales/fr/parsers/FRTimeExpressionParser.ts.html +151 -0
- package/coverage/lcov-report/src/locales/fr/parsers/FRTimeUnitAgoFormatParser.ts.html +151 -0
- package/coverage/lcov-report/src/locales/fr/parsers/FRTimeUnitRelativeFormatParser.ts.html +214 -0
- package/coverage/lcov-report/src/locales/fr/parsers/FRTimeUnitWithinFormatParser.ts.html +130 -0
- package/coverage/lcov-report/src/locales/fr/parsers/FRWeekdayParser.ts.html +223 -0
- package/coverage/lcov-report/src/locales/fr/parsers/index.html +236 -0
- package/coverage/lcov-report/src/locales/fr/refiners/FRMergeDateRangeRefiner.ts.html +130 -0
- package/coverage/lcov-report/src/locales/fr/refiners/FRMergeDateTimeRefiner.ts.html +115 -0
- package/coverage/lcov-report/src/locales/fr/refiners/index.html +131 -0
- package/coverage/lcov-report/src/locales/ja/constants.ts.html +157 -0
- package/coverage/lcov-report/src/locales/ja/index.html +131 -0
- package/coverage/lcov-report/src/locales/ja/index.ts.html +214 -0
- package/coverage/lcov-report/src/locales/ja/parsers/JPCasualDateParser.ts.html +217 -0
- package/coverage/lcov-report/src/locales/ja/parsers/JPStandardParser.ts.html +247 -0
- package/coverage/lcov-report/src/locales/ja/parsers/index.html +131 -0
- package/coverage/lcov-report/src/locales/ja/refiners/JPMergeDateRangeRefiner.ts.html +124 -0
- package/coverage/lcov-report/src/locales/ja/refiners/index.html +116 -0
- package/coverage/lcov-report/src/locales/nl/constants.ts.html +796 -0
- package/coverage/lcov-report/src/locales/nl/index.html +131 -0
- package/coverage/lcov-report/src/locales/nl/index.ts.html +304 -0
- package/coverage/lcov-report/src/locales/nl/parsers/NLCasualDateParser.ts.html +181 -0
- package/coverage/lcov-report/src/locales/nl/parsers/NLCasualDateTimeParser.ts.html +310 -0
- package/coverage/lcov-report/src/locales/nl/parsers/NLCasualTimeParser.ts.html +265 -0
- package/coverage/lcov-report/src/locales/nl/parsers/NLCasualYearMonthDayParser.ts.html +232 -0
- package/coverage/lcov-report/src/locales/nl/parsers/NLMonthNameMiddleEndianParser.ts.html +349 -0
- package/coverage/lcov-report/src/locales/nl/parsers/NLMonthNameParser.ts.html +235 -0
- package/coverage/lcov-report/src/locales/nl/parsers/NLRelativeDateFormatParser.ts.html +295 -0
- package/coverage/lcov-report/src/locales/nl/parsers/NLSlashMonthFormatParser.ts.html +163 -0
- package/coverage/lcov-report/src/locales/nl/parsers/NLTimeExpressionParser.ts.html +163 -0
- package/coverage/lcov-report/src/locales/nl/parsers/NLTimeUnitAgoFormatParser.ts.html +163 -0
- package/coverage/lcov-report/src/locales/nl/parsers/NLTimeUnitCasualRelativeFormatParser.ts.html +166 -0
- package/coverage/lcov-report/src/locales/nl/parsers/NLTimeUnitLaterFormatParser.ts.html +166 -0
- package/coverage/lcov-report/src/locales/nl/parsers/NLTimeUnitWithinFormatParser.ts.html +130 -0
- package/coverage/lcov-report/src/locales/nl/parsers/NLWeekdayParser.ts.html +223 -0
- package/coverage/lcov-report/src/locales/nl/parsers/index.html +311 -0
- package/coverage/lcov-report/src/locales/nl/refiners/NLMergeDateRangeRefiner.ts.html +136 -0
- package/coverage/lcov-report/src/locales/nl/refiners/NLMergeDateTimeRefiner.ts.html +124 -0
- package/coverage/lcov-report/src/locales/nl/refiners/index.html +131 -0
- package/coverage/lcov-report/src/locales/pt/constants.ts.html +343 -0
- package/coverage/lcov-report/src/locales/pt/index.html +131 -0
- package/coverage/lcov-report/src/locales/pt/index.ts.html +256 -0
- package/coverage/lcov-report/src/locales/pt/parsers/PTCasualDateParser.ts.html +181 -0
- package/coverage/lcov-report/src/locales/pt/parsers/PTCasualTimeParser.ts.html +226 -0
- package/coverage/lcov-report/src/locales/pt/parsers/PTMonthNameLittleEndianParser.ts.html +265 -0
- package/coverage/lcov-report/src/locales/pt/parsers/PTTimeExpressionParser.ts.html +145 -0
- package/coverage/lcov-report/src/locales/pt/parsers/PTWeekdayParser.ts.html +235 -0
- package/coverage/lcov-report/src/locales/pt/parsers/index.html +176 -0
- package/coverage/lcov-report/src/locales/pt/refiners/PTMergeDateRangeRefiner.ts.html +130 -0
- package/coverage/lcov-report/src/locales/pt/refiners/PTMergeDateTimeRefiner.ts.html +115 -0
- package/coverage/lcov-report/src/locales/pt/refiners/index.html +131 -0
- package/coverage/lcov-report/src/locales/ru/constants.ts.html +1111 -0
- package/coverage/lcov-report/src/locales/ru/index.html +131 -0
- package/coverage/lcov-report/src/locales/ru/index.ts.html +337 -0
- package/coverage/lcov-report/src/locales/ru/parsers/RUCasualDateParser.ts.html +217 -0
- package/coverage/lcov-report/src/locales/ru/parsers/RUCasualTimeParser.ts.html +253 -0
- package/coverage/lcov-report/src/locales/ru/parsers/RUMonthNameLittleEndianParser.ts.html +301 -0
- package/coverage/lcov-report/src/locales/ru/parsers/RUMonthNameParser.ts.html +268 -0
- package/coverage/lcov-report/src/locales/ru/parsers/RURelativeDateFormatParser.ts.html +310 -0
- package/coverage/lcov-report/src/locales/ru/parsers/RUTimeExpressionParser.ts.html +277 -0
- package/coverage/lcov-report/src/locales/ru/parsers/RUTimeUnitAgoFormatParser.ts.html +157 -0
- package/coverage/lcov-report/src/locales/ru/parsers/RUTimeUnitCasualRelativeFormatParser.ts.html +187 -0
- package/coverage/lcov-report/src/locales/ru/parsers/RUTimeUnitWithinFormatParser.ts.html +157 -0
- package/coverage/lcov-report/src/locales/ru/parsers/RUWeekdayParser.ts.html +256 -0
- package/coverage/lcov-report/src/locales/ru/parsers/index.html +251 -0
- package/coverage/lcov-report/src/locales/ru/refiners/RUMergeDateRangeRefiner.ts.html +124 -0
- package/coverage/lcov-report/src/locales/ru/refiners/RUMergeDateTimeRefiner.ts.html +124 -0
- package/coverage/lcov-report/src/locales/ru/refiners/index.html +131 -0
- package/coverage/lcov-report/src/locales/zh/hans/constants.ts.html +241 -0
- package/coverage/lcov-report/src/locales/zh/hans/index.html +131 -0
- package/coverage/lcov-report/src/locales/zh/hans/index.ts.html +271 -0
- package/coverage/lcov-report/src/locales/zh/hans/parsers/ZHHansCasualDateParser.ts.html +469 -0
- package/coverage/lcov-report/src/locales/zh/hans/parsers/ZHHansDateParser.ts.html +310 -0
- package/coverage/lcov-report/src/locales/zh/hans/parsers/ZHHansDeadlineFormatParser.ts.html +328 -0
- package/coverage/lcov-report/src/locales/zh/hans/parsers/ZHHansRelationWeekdayParser.ts.html +292 -0
- package/coverage/lcov-report/src/locales/zh/hans/parsers/ZHHansTimeExpressionParser.ts.html +1357 -0
- package/coverage/lcov-report/src/locales/zh/hans/parsers/ZHHansWeekdayParser.ts.html +223 -0
- package/coverage/lcov-report/src/locales/zh/hans/parsers/index.html +191 -0
- package/coverage/lcov-report/src/locales/zh/hans/refiners/ZHHansMergeDateRangeRefiner.ts.html +106 -0
- package/coverage/lcov-report/src/locales/zh/hans/refiners/ZHHansMergeDateTimeRefiner.ts.html +106 -0
- package/coverage/lcov-report/src/locales/zh/hans/refiners/index.html +131 -0
- package/coverage/lcov-report/src/locales/zh/hant/constants.ts.html +244 -0
- package/coverage/lcov-report/src/locales/zh/hant/index.html +131 -0
- package/coverage/lcov-report/src/locales/zh/hant/index.ts.html +274 -0
- package/coverage/lcov-report/src/locales/zh/hant/parsers/ZHHantCasualDateParser.ts.html +469 -0
- package/coverage/lcov-report/src/locales/zh/hant/parsers/ZHHantDateParser.ts.html +289 -0
- package/coverage/lcov-report/src/locales/zh/hant/parsers/ZHHantDeadlineFormatParser.ts.html +328 -0
- package/coverage/lcov-report/src/locales/zh/hant/parsers/ZHHantRelationWeekdayParser.ts.html +292 -0
- package/coverage/lcov-report/src/locales/zh/hant/parsers/ZHHantTimeExpressionParser.ts.html +1357 -0
- package/coverage/lcov-report/src/locales/zh/hant/parsers/ZHHantWeekdayParser.ts.html +223 -0
- package/coverage/lcov-report/src/locales/zh/hant/parsers/index.html +191 -0
- package/coverage/lcov-report/src/locales/zh/hant/refiners/ZHHantMergeDateRangeRefiner.ts.html +106 -0
- package/coverage/lcov-report/src/locales/zh/hant/refiners/ZHHantMergeDateTimeRefiner.ts.html +106 -0
- package/coverage/lcov-report/src/locales/zh/hant/refiners/index.html +131 -0
- package/coverage/lcov-report/src/locales/zh/index.html +116 -0
- package/coverage/lcov-report/src/locales/zh/index.ts.html +91 -0
- package/coverage/lcov-report/src/options.js.html +1085 -0
- package/coverage/lcov-report/src/parsers/de/DECasualDateParser.js.html +368 -0
- package/coverage/lcov-report/src/parsers/de/DEDeadlineFormatParser.js.html +374 -0
- package/coverage/lcov-report/src/parsers/de/DEMonthNameLittleEndianParser.js.html +347 -0
- package/coverage/lcov-report/src/parsers/de/DEMonthNameParser.js.html +329 -0
- package/coverage/lcov-report/src/parsers/de/DESlashDateFormatParser.js.html +398 -0
- package/coverage/lcov-report/src/parsers/de/DETimeAgoFormatParser.js.html +401 -0
- package/coverage/lcov-report/src/parsers/de/DETimeExpressionParser.js.html +836 -0
- package/coverage/lcov-report/src/parsers/de/DEWeekdayParser.js.html +338 -0
- package/coverage/lcov-report/src/parsers/de/index.html +216 -0
- package/coverage/lcov-report/src/parsers/en/ENCasualDateParser.js.html +275 -0
- package/coverage/lcov-report/src/parsers/en/ENCasualTimeParser.js.html +242 -0
- package/coverage/lcov-report/src/parsers/en/ENDeadlineFormatParser.js.html +359 -0
- package/coverage/lcov-report/src/parsers/en/ENISOFormatParser.js.html +389 -0
- package/coverage/lcov-report/src/parsers/en/ENMonthNameLittleEndianParser.js.html +416 -0
- package/coverage/lcov-report/src/parsers/en/ENMonthNameMiddleEndianParser.js.html +437 -0
- package/coverage/lcov-report/src/parsers/en/ENMonthNameParser.js.html +320 -0
- package/coverage/lcov-report/src/parsers/en/ENRelativeDateFormatParser.js.html +518 -0
- package/coverage/lcov-report/src/parsers/en/ENSlashDateFormatParser.js.html +479 -0
- package/coverage/lcov-report/src/parsers/en/ENSlashDateFormatStartWithYearParser.js.html +245 -0
- package/coverage/lcov-report/src/parsers/en/ENSlashMonthFormatParser.js.html +221 -0
- package/coverage/lcov-report/src/parsers/en/ENTimeAgoFormatParser.js.html +287 -0
- package/coverage/lcov-report/src/parsers/en/ENTimeExpressionParser.js.html +869 -0
- package/coverage/lcov-report/src/parsers/en/ENTimeLaterFormatParser.js.html +305 -0
- package/coverage/lcov-report/src/parsers/en/ENWeekdayParser.js.html +356 -0
- package/coverage/lcov-report/src/parsers/en/index.html +321 -0
- package/coverage/lcov-report/src/parsers/es/ESCasualDateParser.js.html +452 -0
- package/coverage/lcov-report/src/parsers/es/ESDeadlineFormatParser.js.html +260 -0
- package/coverage/lcov-report/src/parsers/es/ESMonthNameLittleEndianParser.js.html +338 -0
- package/coverage/lcov-report/src/parsers/es/ESSlashDateFormatParser.js.html +419 -0
- package/coverage/lcov-report/src/parsers/es/ESTimeAgoFormatParser.js.html +341 -0
- package/coverage/lcov-report/src/parsers/es/ESTimeExpressionParser.js.html +782 -0
- package/coverage/lcov-report/src/parsers/es/ESWeekdayParser.js.html +260 -0
- package/coverage/lcov-report/src/parsers/es/index.html +201 -0
- package/coverage/lcov-report/src/parsers/fr/FRCasualDateParser.js.html +311 -0
- package/coverage/lcov-report/src/parsers/fr/FRDeadlineFormatParser.js.html +359 -0
- package/coverage/lcov-report/src/parsers/fr/FRMonthNameLittleEndianParser.js.html +338 -0
- package/coverage/lcov-report/src/parsers/fr/FRRelativeDateFormatParser.js.html +545 -0
- package/coverage/lcov-report/src/parsers/fr/FRSlashDateFormatParser.js.html +437 -0
- package/coverage/lcov-report/src/parsers/fr/FRTimeAgoFormatParser.js.html +341 -0
- package/coverage/lcov-report/src/parsers/fr/FRTimeExpressionParser.js.html +803 -0
- package/coverage/lcov-report/src/parsers/fr/FRWeekdayParser.js.html +257 -0
- package/coverage/lcov-report/src/parsers/fr/index.html +216 -0
- package/coverage/lcov-report/src/parsers/index.html +111 -0
- package/coverage/lcov-report/src/parsers/ja/JPCasualDateParser.js.html +245 -0
- package/coverage/lcov-report/src/parsers/ja/JPStandardParser.js.html +293 -0
- package/coverage/lcov-report/src/parsers/ja/index.html +126 -0
- package/coverage/lcov-report/src/parsers/nl/NLCasualDateParser.js.html +395 -0
- package/coverage/lcov-report/src/parsers/nl/NLCasualTimeParser.js.html +278 -0
- package/coverage/lcov-report/src/parsers/nl/NLMonthNameLittleEndianParser.js.html +383 -0
- package/coverage/lcov-report/src/parsers/nl/NLMonthNameParser.js.html +320 -0
- package/coverage/lcov-report/src/parsers/nl/NLSlashDateFormatParser.js.html +389 -0
- package/coverage/lcov-report/src/parsers/nl/NLTimeExpressionParser.js.html +836 -0
- package/coverage/lcov-report/src/parsers/nl/NLWeekdayParser.js.html +377 -0
- package/coverage/lcov-report/src/parsers/nl/index.html +201 -0
- package/coverage/lcov-report/src/parsers/parser.js.html +500 -0
- package/coverage/lcov-report/src/parsers/pt/PTCasualDateParser.js.html +449 -0
- package/coverage/lcov-report/src/parsers/pt/PTDeadlineFormatParser.js.html +263 -0
- package/coverage/lcov-report/src/parsers/pt/PTMonthNameLittleEndianParser.js.html +338 -0
- package/coverage/lcov-report/src/parsers/pt/PTSlashDateFormatParser.js.html +419 -0
- package/coverage/lcov-report/src/parsers/pt/PTTimeAgoFormatParser.js.html +341 -0
- package/coverage/lcov-report/src/parsers/pt/PTTimeExpressionParser.js.html +782 -0
- package/coverage/lcov-report/src/parsers/pt/PTWeekdayParser.js.html +260 -0
- package/coverage/lcov-report/src/parsers/pt/index.html +201 -0
- package/coverage/lcov-report/src/parsers/zh-Hant/ZHHantCasualDateParser.js.html +494 -0
- package/coverage/lcov-report/src/parsers/zh-Hant/ZHHantDateParser.js.html +281 -0
- package/coverage/lcov-report/src/parsers/zh-Hant/ZHHantDeadlineFormatParser.js.html +353 -0
- package/coverage/lcov-report/src/parsers/zh-Hant/ZHHantTimeExpressionParser.js.html +1346 -0
- package/coverage/lcov-report/src/parsers/zh-Hant/ZHHantWeekdayParser.js.html +239 -0
- package/coverage/lcov-report/src/parsers/zh-Hant/index.html +171 -0
- package/coverage/lcov-report/src/refiners/ExtractTimezoneAbbrRefiner.js.html +245 -0
- package/coverage/lcov-report/src/refiners/ExtractTimezoneOffsetRefiner.js.html +218 -0
- package/coverage/lcov-report/src/refiners/ForwardDateRefiner.js.html +239 -0
- package/coverage/lcov-report/src/refiners/OverlapRemovalRefiner.js.html +200 -0
- package/coverage/lcov-report/src/refiners/UnlikelyFormatFilter.js.html +131 -0
- package/coverage/lcov-report/src/refiners/de/DEMergeDateRangeRefiner.js.html +116 -0
- package/coverage/lcov-report/src/refiners/de/DEMergeDateTimeRefiner.js.html +377 -0
- package/coverage/lcov-report/src/refiners/de/index.html +126 -0
- package/coverage/lcov-report/src/refiners/en/ENMergeDateRangeRefiner.js.html +416 -0
- package/coverage/lcov-report/src/refiners/en/ENMergeDateTimeRefiner.js.html +533 -0
- package/coverage/lcov-report/src/refiners/en/ENPrioritizeSpecificDateRefiner.js.html +422 -0
- package/coverage/lcov-report/src/refiners/en/index.html +141 -0
- package/coverage/lcov-report/src/refiners/fr/FRMergeDateRangeRefiner.js.html +374 -0
- package/coverage/lcov-report/src/refiners/fr/FRMergeDateTimeRefiner.js.html +395 -0
- package/coverage/lcov-report/src/refiners/fr/index.html +126 -0
- package/coverage/lcov-report/src/refiners/index.html +186 -0
- package/coverage/lcov-report/src/refiners/ja/JPMergeDateRangeRefiner.js.html +113 -0
- package/coverage/lcov-report/src/refiners/ja/index.html +111 -0
- package/coverage/lcov-report/src/refiners/nl/NLMergeDateRangeRefiner.js.html +116 -0
- package/coverage/lcov-report/src/refiners/nl/NLMergeDateTimeRefiner.js.html +362 -0
- package/coverage/lcov-report/src/refiners/nl/index.html +126 -0
- package/coverage/lcov-report/src/refiners/refiner.js.html +239 -0
- package/coverage/lcov-report/src/result.js.html +545 -0
- package/coverage/lcov-report/src/results.ts.html +916 -0
- package/coverage/lcov-report/src/timezone.ts.html +700 -0
- package/coverage/lcov-report/src/utils/DE.js.html +308 -0
- package/coverage/lcov-report/src/utils/EN.js.html +596 -0
- package/coverage/lcov-report/src/utils/ES.js.html +254 -0
- package/coverage/lcov-report/src/utils/FR.js.html +302 -0
- package/coverage/lcov-report/src/utils/JP.js.html +215 -0
- package/coverage/lcov-report/src/utils/NL.js.html +620 -0
- package/coverage/lcov-report/src/utils/PT.js.html +263 -0
- package/coverage/lcov-report/src/utils/ParserWithWordEndingDetection.ts.html +176 -0
- package/coverage/lcov-report/src/utils/ZH-Hant.js.html +236 -0
- package/coverage/lcov-report/src/utils/dayjs.ts.html +223 -0
- package/coverage/lcov-report/src/utils/index.html +146 -0
- package/coverage/lcov-report/src/utils/pattern.ts.html +175 -0
- package/coverage/lcov-report/src/utils/timeunits.ts.html +199 -0
- package/coverage/lcov-report/test/index.html +116 -0
- package/coverage/lcov-report/test/test_util.js.html +299 -0
- package/coverage/lcov-report/test/test_util.ts.html +490 -0
- package/coverage/lcov.info +8049 -0
- package/dist/common/casualReferences.d.ts +1 -0
- package/dist/common/casualReferences.js +23 -2
- package/dist/common/casualReferences.js.map +1 -1
- package/dist/common/parsers/SlashDateFormatParser.js +5 -3
- package/dist/common/parsers/SlashDateFormatParser.js.map +1 -1
- package/dist/common/refiners/AbstractMergeDateTimeRefiner.d.ts +1 -1
- package/dist/common/refiners/AbstractMergeDateTimeRefiner.js +2 -2
- package/dist/common/refiners/AbstractMergeDateTimeRefiner.js.map +1 -1
- package/dist/common/refiners/ForwardDateRefiner.js +12 -0
- package/dist/common/refiners/ForwardDateRefiner.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/locales/en/constants.js +6 -0
- package/dist/locales/en/constants.js.map +1 -1
- package/dist/locales/en/parsers/ENCasualTimeParser.js +27 -26
- package/dist/locales/en/parsers/ENCasualTimeParser.js.map +1 -1
- package/dist/locales/es/constants.d.ts +8 -0
- package/dist/locales/es/constants.js +84 -0
- package/dist/locales/es/constants.js.map +1 -0
- package/dist/locales/es/index.d.ts +8 -0
- package/dist/locales/es/index.js +46 -0
- package/dist/locales/es/index.js.map +1 -0
- package/dist/locales/es/parsers/ESCasualDateParser.d.ts +7 -0
- package/dist/locales/es/parsers/ESCasualDateParser.js +45 -0
- package/dist/locales/es/parsers/ESCasualDateParser.js.map +1 -0
- package/dist/locales/es/parsers/ESCasualTimeParser.d.ts +6 -0
- package/dist/locales/es/parsers/ESCasualTimeParser.js +46 -0
- package/dist/locales/es/parsers/ESCasualTimeParser.js.map +1 -0
- package/dist/locales/es/parsers/ESMonthNameLittleEndianParser.d.ts +7 -0
- package/dist/locales/es/parsers/ESMonthNameLittleEndianParser.js +49 -0
- package/dist/locales/es/parsers/ESMonthNameLittleEndianParser.js.map +1 -0
- package/dist/locales/es/parsers/ESTimeExpressionParser.d.ts +5 -0
- package/dist/locales/es/parsers/ESTimeExpressionParser.js +13 -0
- package/dist/locales/es/parsers/ESTimeExpressionParser.js.map +1 -0
- package/dist/locales/es/parsers/ESWeekdayParser.d.ts +7 -0
- package/dist/locales/es/parsers/ESWeekdayParser.js +44 -0
- package/dist/locales/es/parsers/ESWeekdayParser.js.map +1 -0
- package/dist/locales/es/refiners/ESMergeDateRangeRefiner.d.ts +4 -0
- package/dist/locales/es/refiners/ESMergeDateRangeRefiner.js +13 -0
- package/dist/locales/es/refiners/ESMergeDateRangeRefiner.js.map +1 -0
- package/dist/locales/es/refiners/ESMergeDateTimeRefiner.d.ts +4 -0
- package/dist/locales/es/refiners/ESMergeDateTimeRefiner.js +13 -0
- package/dist/locales/es/refiners/ESMergeDateTimeRefiner.js.map +1 -0
- package/dist/locales/ru/parsers/RUTimeUnitCasualRelativeFormatParser.js +1 -1
- package/dist/locales/ru/parsers/RUTimeUnitCasualRelativeFormatParser.js.map +1 -1
- package/dist/locales/zh/hans/parsers/ZHHansTimeExpressionParser.js +26 -26
- package/dist/locales/zh/hans/parsers/ZHHansTimeExpressionParser.js.map +1 -1
- package/dist/locales/zh/hant/parsers/ZHHantTimeExpressionParser.js +26 -26
- package/dist/locales/zh/hant/parsers/ZHHantTimeExpressionParser.js.map +1 -1
- package/dist/utils/dayjs.d.ts +2 -0
- package/dist/utils/dayjs.js +13 -1
- package/dist/utils/dayjs.js.map +1 -1
- package/docs/assets/css/main.css +2660 -0
- package/docs/assets/images/icons.png +0 -0
- package/docs/assets/images/icons@2x.png +0 -0
- package/docs/assets/images/widgets.png +0 -0
- package/docs/assets/images/widgets@2x.png +0 -0
- package/docs/assets/js/main.js +248 -0
- package/docs/assets/js/search.js +1 -0
- package/docs/classes/chrono.html +377 -0
- package/docs/enums/meridiem.html +191 -0
- package/docs/index.html +329 -0
- package/docs/interfaces/parsedcomponents.html +270 -0
- package/docs/interfaces/parsedresult.html +283 -0
- package/docs/interfaces/parser.html +240 -0
- package/docs/interfaces/parsingoption.html +218 -0
- package/docs/interfaces/refiner.html +218 -0
- package/docs/modules/de.html +298 -0
- package/docs/modules/en.html +361 -0
- package/docs/modules/fr.html +248 -0
- package/docs/modules/ja.html +248 -0
- package/docs/modules/nl.html +275 -0
- package/docs/modules/pt.html +248 -0
- package/package.json +1 -1
- package/src/common/casualReferences.ts +31 -2
- package/src/common/parsers/SlashDateFormatParser.ts +7 -6
- package/src/common/refiners/AbstractMergeDateTimeRefiner.ts +1 -1
- package/src/common/refiners/ForwardDateRefiner.ts +13 -0
- package/src/index.ts +2 -1
- package/src/locales/en/constants.ts +6 -0
- package/src/locales/en/parsers/ENCasualTimeParser.ts +9 -31
- package/src/locales/es/constants.ts +85 -0
- package/src/locales/es/index.ts +57 -0
- package/src/locales/es/parsers/ESCasualDateParser.ts +31 -0
- package/src/locales/es/parsers/ESCasualTimeParser.ts +47 -0
- package/src/locales/es/parsers/ESMonthNameLittleEndianParser.ts +60 -0
- package/src/locales/es/parsers/ESTimeExpressionParser.ts +20 -0
- package/src/locales/es/parsers/ESWeekdayParser.ts +50 -0
- package/src/locales/es/refiners/ESMergeDateRangeRefiner.ts +15 -0
- package/src/locales/es/refiners/ESMergeDateTimeRefiner.ts +10 -0
- package/src/locales/ru/parsers/RUTimeUnitCasualRelativeFormatParser.ts +1 -1
- package/src/locales/ru/refiners/RUMergeDateTimeRefiner.ts +1 -1
- package/src/locales/zh/hans/parsers/ZHHansTimeExpressionParser.ts +26 -26
- package/src/locales/zh/hant/parsers/ZHHantTimeExpressionParser.ts +26 -26
- package/src/utils/dayjs.ts +12 -0
- package/test/en/en_casual.test.ts +34 -4
- package/test/en/en_slash.test.ts +12 -11
- package/test/en/en_time_exp.test.ts +53 -0
- package/test/en/en_time_units_ago.test.ts +17 -0
- package/test/en/en_time_units_later.test.ts +30 -0
- package/test/en/negative_cases.test.ts +11 -0
- package/test/es/es_casual.test.ts +175 -0
- package/test/es/es_month_name_little_endian.test.ts +217 -0
- package/test/es/es_slash.test.ts +26 -0
- package/test/es/es_time_exp.test.ts +175 -0
- package/test/ru/ru_time_units_casual_relative.test.ts +12 -0
- package/test/zh/zh_hans_time_exp.test.ts +15 -0
- package/test/zh/zh_hant_time_exp.test.ts +14 -0
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html class="default no-js">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
6
|
+
<title>pt | Chrono - v2.2.7</title>
|
|
7
|
+
<meta name="description" content="Documentation for Chrono - v2.2.7">
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
9
|
+
<link rel="stylesheet" href="../assets/css/main.css">
|
|
10
|
+
<script async src="../assets/js/search.js" id="search-script"></script>
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
<header>
|
|
14
|
+
<div class="tsd-page-toolbar">
|
|
15
|
+
<div class="container">
|
|
16
|
+
<div class="table-wrap">
|
|
17
|
+
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
|
|
18
|
+
<div class="field">
|
|
19
|
+
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
|
|
20
|
+
<input id="tsd-search-field" type="text" />
|
|
21
|
+
</div>
|
|
22
|
+
<ul class="results">
|
|
23
|
+
<li class="state loading">Preparing search index...</li>
|
|
24
|
+
<li class="state failure">The search index is not available</li>
|
|
25
|
+
</ul>
|
|
26
|
+
<a href="../index.html" class="title">Chrono - v2.2.7</a>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="table-cell" id="tsd-widgets">
|
|
29
|
+
<div id="tsd-filter">
|
|
30
|
+
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
|
|
31
|
+
<div class="tsd-filter-group">
|
|
32
|
+
<div class="tsd-select" id="tsd-filter-visibility">
|
|
33
|
+
<span class="tsd-select-label">All</span>
|
|
34
|
+
<ul class="tsd-select-list">
|
|
35
|
+
<li data-value="public">Public</li>
|
|
36
|
+
<li data-value="protected">Public/Protected</li>
|
|
37
|
+
<li data-value="private" class="selected">All</li>
|
|
38
|
+
</ul>
|
|
39
|
+
</div>
|
|
40
|
+
<input type="checkbox" id="tsd-filter-inherited" checked />
|
|
41
|
+
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
|
|
42
|
+
<input type="checkbox" id="tsd-filter-externals" checked />
|
|
43
|
+
<label class="tsd-widget" for="tsd-filter-externals">Externals</label>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
<div class="tsd-page-title">
|
|
52
|
+
<div class="container">
|
|
53
|
+
<ul class="tsd-breadcrumb">
|
|
54
|
+
<li>
|
|
55
|
+
<a href="../index.html">Chrono - v2.2.7</a>
|
|
56
|
+
</li>
|
|
57
|
+
<li>
|
|
58
|
+
<a href="pt.html">pt</a>
|
|
59
|
+
</li>
|
|
60
|
+
</ul>
|
|
61
|
+
<h1>Namespace pt</h1>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</header>
|
|
65
|
+
<div class="container container-main">
|
|
66
|
+
<div class="row">
|
|
67
|
+
<div class="col-8 col-content">
|
|
68
|
+
<section class="tsd-panel tsd-comment">
|
|
69
|
+
<div class="tsd-comment tsd-typography">
|
|
70
|
+
<div class="lead">
|
|
71
|
+
<p>Chrono components for Portuguese support (<em>parsers</em>, <em>refiners</em>, and <em>configuration</em>)</p>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</section>
|
|
75
|
+
<section class="tsd-panel-group tsd-index-group">
|
|
76
|
+
<h2>Index</h2>
|
|
77
|
+
<section class="tsd-panel tsd-index-panel">
|
|
78
|
+
<div class="tsd-index-content">
|
|
79
|
+
<section class="tsd-index-section ">
|
|
80
|
+
<h3>Variables</h3>
|
|
81
|
+
<ul class="tsd-index-list">
|
|
82
|
+
<li class="tsd-kind-variable tsd-parent-kind-namespace"><a href="pt.html#casual" class="tsd-kind-icon">casual</a></li>
|
|
83
|
+
<li class="tsd-kind-variable tsd-parent-kind-namespace"><a href="pt.html#strict" class="tsd-kind-icon">strict</a></li>
|
|
84
|
+
</ul>
|
|
85
|
+
</section>
|
|
86
|
+
<section class="tsd-index-section ">
|
|
87
|
+
<h3>Functions</h3>
|
|
88
|
+
<ul class="tsd-index-list">
|
|
89
|
+
<li class="tsd-kind-function tsd-parent-kind-namespace"><a href="pt.html#parse" class="tsd-kind-icon">parse</a></li>
|
|
90
|
+
<li class="tsd-kind-function tsd-parent-kind-namespace"><a href="pt.html#parsedate" class="tsd-kind-icon">parse<wbr>Date</a></li>
|
|
91
|
+
</ul>
|
|
92
|
+
</section>
|
|
93
|
+
</div>
|
|
94
|
+
</section>
|
|
95
|
+
</section>
|
|
96
|
+
<section class="tsd-panel-group tsd-member-group ">
|
|
97
|
+
<h2>Variables</h2>
|
|
98
|
+
<section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-namespace">
|
|
99
|
+
<a name="casual" class="tsd-anchor"></a>
|
|
100
|
+
<h3><span class="tsd-flag ts-flagConst">Const</span> casual</h3>
|
|
101
|
+
<div class="tsd-signature tsd-kind-icon">casual<span class="tsd-signature-symbol">:</span> <a href="../classes/chrono.html" class="tsd-signature-type" data-tsd-kind="Class">Chrono</a><span class="tsd-signature-symbol"> = ...</span></div>
|
|
102
|
+
<aside class="tsd-sources">
|
|
103
|
+
<ul>
|
|
104
|
+
<li>Defined in <a href="https://github.com/wanasit/chrono/blob/59d06db/src/locales/pt/index.ts#L20">locales/pt/index.ts:20</a></li>
|
|
105
|
+
</ul>
|
|
106
|
+
</aside>
|
|
107
|
+
</section>
|
|
108
|
+
<section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-namespace">
|
|
109
|
+
<a name="strict" class="tsd-anchor"></a>
|
|
110
|
+
<h3><span class="tsd-flag ts-flagConst">Const</span> strict</h3>
|
|
111
|
+
<div class="tsd-signature tsd-kind-icon">strict<span class="tsd-signature-symbol">:</span> <a href="../classes/chrono.html" class="tsd-signature-type" data-tsd-kind="Class">Chrono</a><span class="tsd-signature-symbol"> = ...</span></div>
|
|
112
|
+
<aside class="tsd-sources">
|
|
113
|
+
<ul>
|
|
114
|
+
<li>Defined in <a href="https://github.com/wanasit/chrono/blob/59d06db/src/locales/pt/index.ts#L21">locales/pt/index.ts:21</a></li>
|
|
115
|
+
</ul>
|
|
116
|
+
</aside>
|
|
117
|
+
</section>
|
|
118
|
+
</section>
|
|
119
|
+
<section class="tsd-panel-group tsd-member-group ">
|
|
120
|
+
<h2>Functions</h2>
|
|
121
|
+
<section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-namespace">
|
|
122
|
+
<a name="parse" class="tsd-anchor"></a>
|
|
123
|
+
<h3>parse</h3>
|
|
124
|
+
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-namespace">
|
|
125
|
+
<li class="tsd-signature tsd-kind-icon">parse<span class="tsd-signature-symbol">(</span>text<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, ref<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Date</span>, option<span class="tsd-signature-symbol">?: </span><a href="../interfaces/parsingoption.html" class="tsd-signature-type" data-tsd-kind="Interface">ParsingOption</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/parsedresult.html" class="tsd-signature-type" data-tsd-kind="Interface">ParsedResult</a><span class="tsd-signature-symbol">[]</span></li>
|
|
126
|
+
</ul>
|
|
127
|
+
<ul class="tsd-descriptions">
|
|
128
|
+
<li class="tsd-description">
|
|
129
|
+
<aside class="tsd-sources">
|
|
130
|
+
<ul>
|
|
131
|
+
<li>Defined in <a href="https://github.com/wanasit/chrono/blob/59d06db/src/locales/pt/index.ts#L23">locales/pt/index.ts:23</a></li>
|
|
132
|
+
</ul>
|
|
133
|
+
</aside>
|
|
134
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
135
|
+
<ul class="tsd-parameters">
|
|
136
|
+
<li>
|
|
137
|
+
<h5>text: <span class="tsd-signature-type">string</span></h5>
|
|
138
|
+
</li>
|
|
139
|
+
<li>
|
|
140
|
+
<h5><span class="tsd-flag ts-flagOptional">Optional</span> ref: <span class="tsd-signature-type">Date</span></h5>
|
|
141
|
+
</li>
|
|
142
|
+
<li>
|
|
143
|
+
<h5><span class="tsd-flag ts-flagOptional">Optional</span> option: <a href="../interfaces/parsingoption.html" class="tsd-signature-type" data-tsd-kind="Interface">ParsingOption</a></h5>
|
|
144
|
+
</li>
|
|
145
|
+
</ul>
|
|
146
|
+
<h4 class="tsd-returns-title">Returns <a href="../interfaces/parsedresult.html" class="tsd-signature-type" data-tsd-kind="Interface">ParsedResult</a><span class="tsd-signature-symbol">[]</span></h4>
|
|
147
|
+
</li>
|
|
148
|
+
</ul>
|
|
149
|
+
</section>
|
|
150
|
+
<section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-namespace">
|
|
151
|
+
<a name="parsedate" class="tsd-anchor"></a>
|
|
152
|
+
<h3>parse<wbr>Date</h3>
|
|
153
|
+
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-namespace">
|
|
154
|
+
<li class="tsd-signature tsd-kind-icon">parse<wbr>Date<span class="tsd-signature-symbol">(</span>text<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, ref<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Date</span>, option<span class="tsd-signature-symbol">?: </span><a href="../interfaces/parsingoption.html" class="tsd-signature-type" data-tsd-kind="Interface">ParsingOption</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Date</span></li>
|
|
155
|
+
</ul>
|
|
156
|
+
<ul class="tsd-descriptions">
|
|
157
|
+
<li class="tsd-description">
|
|
158
|
+
<aside class="tsd-sources">
|
|
159
|
+
<ul>
|
|
160
|
+
<li>Defined in <a href="https://github.com/wanasit/chrono/blob/59d06db/src/locales/pt/index.ts#L27">locales/pt/index.ts:27</a></li>
|
|
161
|
+
</ul>
|
|
162
|
+
</aside>
|
|
163
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
164
|
+
<ul class="tsd-parameters">
|
|
165
|
+
<li>
|
|
166
|
+
<h5>text: <span class="tsd-signature-type">string</span></h5>
|
|
167
|
+
</li>
|
|
168
|
+
<li>
|
|
169
|
+
<h5><span class="tsd-flag ts-flagOptional">Optional</span> ref: <span class="tsd-signature-type">Date</span></h5>
|
|
170
|
+
</li>
|
|
171
|
+
<li>
|
|
172
|
+
<h5><span class="tsd-flag ts-flagOptional">Optional</span> option: <a href="../interfaces/parsingoption.html" class="tsd-signature-type" data-tsd-kind="Interface">ParsingOption</a></h5>
|
|
173
|
+
</li>
|
|
174
|
+
</ul>
|
|
175
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Date</span></h4>
|
|
176
|
+
</li>
|
|
177
|
+
</ul>
|
|
178
|
+
</section>
|
|
179
|
+
</section>
|
|
180
|
+
</div>
|
|
181
|
+
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
182
|
+
<nav class="tsd-navigation primary">
|
|
183
|
+
<ul>
|
|
184
|
+
<li class=" ">
|
|
185
|
+
<a href="../index.html">Exports</a>
|
|
186
|
+
</li>
|
|
187
|
+
<li class=" tsd-kind-namespace">
|
|
188
|
+
<a href="de.html">de</a>
|
|
189
|
+
</li>
|
|
190
|
+
<li class=" tsd-kind-namespace">
|
|
191
|
+
<a href="en.html">en</a>
|
|
192
|
+
</li>
|
|
193
|
+
<li class=" tsd-kind-namespace">
|
|
194
|
+
<a href="fr.html">fr</a>
|
|
195
|
+
</li>
|
|
196
|
+
<li class=" tsd-kind-namespace">
|
|
197
|
+
<a href="ja.html">ja</a>
|
|
198
|
+
</li>
|
|
199
|
+
<li class=" tsd-kind-namespace">
|
|
200
|
+
<a href="nl.html">nl</a>
|
|
201
|
+
</li>
|
|
202
|
+
<li class="current tsd-kind-namespace">
|
|
203
|
+
<a href="pt.html">pt</a>
|
|
204
|
+
</li>
|
|
205
|
+
</ul>
|
|
206
|
+
</nav>
|
|
207
|
+
<nav class="tsd-navigation secondary menu-sticky">
|
|
208
|
+
<ul class="before-current">
|
|
209
|
+
<li class=" tsd-kind-variable tsd-parent-kind-namespace">
|
|
210
|
+
<a href="pt.html#casual" class="tsd-kind-icon">casual</a>
|
|
211
|
+
</li>
|
|
212
|
+
<li class=" tsd-kind-variable tsd-parent-kind-namespace">
|
|
213
|
+
<a href="pt.html#strict" class="tsd-kind-icon">strict</a>
|
|
214
|
+
</li>
|
|
215
|
+
<li class=" tsd-kind-function tsd-parent-kind-namespace">
|
|
216
|
+
<a href="pt.html#parse" class="tsd-kind-icon">parse</a>
|
|
217
|
+
</li>
|
|
218
|
+
<li class=" tsd-kind-function tsd-parent-kind-namespace">
|
|
219
|
+
<a href="pt.html#parsedate" class="tsd-kind-icon">parse<wbr>Date</a>
|
|
220
|
+
</li>
|
|
221
|
+
</ul>
|
|
222
|
+
</nav>
|
|
223
|
+
</div>
|
|
224
|
+
</div>
|
|
225
|
+
</div>
|
|
226
|
+
<footer class="with-border-bottom">
|
|
227
|
+
<div class="container">
|
|
228
|
+
<h2>Legend</h2>
|
|
229
|
+
<div class="tsd-legend-group">
|
|
230
|
+
<ul class="tsd-legend">
|
|
231
|
+
<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
|
|
232
|
+
<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
|
|
233
|
+
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
|
|
234
|
+
</ul>
|
|
235
|
+
<ul class="tsd-legend">
|
|
236
|
+
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
|
|
237
|
+
<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
|
|
238
|
+
</ul>
|
|
239
|
+
</div>
|
|
240
|
+
</div>
|
|
241
|
+
</footer>
|
|
242
|
+
<div class="container tsd-generator">
|
|
243
|
+
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p>
|
|
244
|
+
</div>
|
|
245
|
+
<div class="overlay"></div>
|
|
246
|
+
<script src="../assets/js/main.js"></script>
|
|
247
|
+
</body>
|
|
248
|
+
</html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { ParsingComponents, ReferenceWithTimezone } from "../results";
|
|
2
2
|
import dayjs from "dayjs";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
assignSimilarDate,
|
|
5
|
+
assignSimilarTime,
|
|
6
|
+
implySimilarDate,
|
|
7
|
+
implySimilarTime,
|
|
8
|
+
implyTheNextDay,
|
|
9
|
+
} from "../utils/dayjs";
|
|
4
10
|
import { Meridiem } from "../index";
|
|
5
11
|
|
|
6
12
|
export function now(reference: ReferenceWithTimezone): ParsingComponents {
|
|
@@ -88,9 +94,16 @@ export function yesterdayEvening(reference: ReferenceWithTimezone, implyHour = 2
|
|
|
88
94
|
|
|
89
95
|
export function midnight(reference: ReferenceWithTimezone): ParsingComponents {
|
|
90
96
|
const component = new ParsingComponents(reference, {});
|
|
91
|
-
|
|
97
|
+
const targetDate = dayjs(reference.instant);
|
|
98
|
+
if (targetDate.hour() > 2) {
|
|
99
|
+
// Unless it's very early morning (0~2AM), we assume the midnight is the coming midnight.
|
|
100
|
+
// Thus, increasing the day by 1.
|
|
101
|
+
implyTheNextDay(component, targetDate);
|
|
102
|
+
}
|
|
103
|
+
component.assign("hour", 0);
|
|
92
104
|
component.imply("minute", 0);
|
|
93
105
|
component.imply("second", 0);
|
|
106
|
+
component.imply("millisecond", 0);
|
|
94
107
|
return component;
|
|
95
108
|
}
|
|
96
109
|
|
|
@@ -98,6 +111,19 @@ export function morning(reference: ReferenceWithTimezone, implyHour = 6): Parsin
|
|
|
98
111
|
const component = new ParsingComponents(reference, {});
|
|
99
112
|
component.imply("meridiem", Meridiem.AM);
|
|
100
113
|
component.imply("hour", implyHour);
|
|
114
|
+
component.imply("minute", 0);
|
|
115
|
+
component.imply("second", 0);
|
|
116
|
+
component.imply("millisecond", 0);
|
|
117
|
+
return component;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export function afternoon(reference: ReferenceWithTimezone, implyHour = 15): ParsingComponents {
|
|
121
|
+
const component = new ParsingComponents(reference, {});
|
|
122
|
+
component.imply("meridiem", Meridiem.PM);
|
|
123
|
+
component.imply("hour", implyHour);
|
|
124
|
+
component.imply("minute", 0);
|
|
125
|
+
component.imply("second", 0);
|
|
126
|
+
component.imply("millisecond", 0);
|
|
101
127
|
return component;
|
|
102
128
|
}
|
|
103
129
|
|
|
@@ -105,5 +131,8 @@ export function noon(reference: ReferenceWithTimezone): ParsingComponents {
|
|
|
105
131
|
const component = new ParsingComponents(reference, {});
|
|
106
132
|
component.imply("meridiem", Meridiem.AM);
|
|
107
133
|
component.imply("hour", 12);
|
|
134
|
+
component.imply("minute", 0);
|
|
135
|
+
component.imply("second", 0);
|
|
136
|
+
component.imply("millisecond", 0);
|
|
108
137
|
return component;
|
|
109
138
|
}
|
|
@@ -39,12 +39,13 @@ export default class SlashDateFormatParser implements Parser {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
extract(context: ParsingContext, match: RegExpMatchArray): ParsingResult {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
// Because of how pattern is executed on remaining text in `chrono.ts`, the character before the match could
|
|
43
|
+
// still be a number (e.g. X[X/YY/ZZ] or XX[/YY/ZZ] or [XX/YY/]ZZ). We want to check and skip them.
|
|
44
|
+
if (match[OPENING_GROUP].length == 0 && match.index > 0 && match.index < context.text.length) {
|
|
45
|
+
const previousChar = context.text[match.index - 1];
|
|
46
|
+
if (previousChar >= "0" && previousChar <= "9") {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
const index = match.index + match[OPENING_GROUP].length;
|
|
@@ -6,7 +6,7 @@ import { MergingRefiner } from "../abstractRefiners";
|
|
|
6
6
|
import { ParsingResult } from "../../results";
|
|
7
7
|
import { mergeDateTimeResult } from "../../calculation/mergingCalculation";
|
|
8
8
|
|
|
9
|
-
export default abstract class
|
|
9
|
+
export default abstract class AbstractMergeDateTimeRefiner extends MergingRefiner {
|
|
10
10
|
abstract patternBetween(): RegExp;
|
|
11
11
|
|
|
12
12
|
shouldMergeResults(textBetween: string, currentResult: ParsingResult, nextResult: ParsingResult): boolean {
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import { ParsingContext, Refiner } from "../../chrono";
|
|
8
8
|
import { ParsingResult } from "../../results";
|
|
9
9
|
import dayjs from "dayjs";
|
|
10
|
+
import { implySimilarDate } from "../../utils/dayjs";
|
|
10
11
|
|
|
11
12
|
export default class ForwardDateRefiner implements Refiner {
|
|
12
13
|
refine(context: ParsingContext, results: ParsingResult[]): ParsingResult[] {
|
|
@@ -17,6 +18,18 @@ export default class ForwardDateRefiner implements Refiner {
|
|
|
17
18
|
results.forEach(function (result) {
|
|
18
19
|
let refMoment = dayjs(context.refDate);
|
|
19
20
|
|
|
21
|
+
if (result.start.isOnlyTime() && refMoment.isAfter(result.start.dayjs())) {
|
|
22
|
+
refMoment = refMoment.add(1, "day");
|
|
23
|
+
implySimilarDate(result.start, refMoment);
|
|
24
|
+
if (result.end && result.end.isOnlyTime()) {
|
|
25
|
+
implySimilarDate(result.end, refMoment);
|
|
26
|
+
if (result.start.dayjs().isAfter(result.end.dayjs())) {
|
|
27
|
+
refMoment = refMoment.add(1, "day");
|
|
28
|
+
implySimilarDate(result.end, refMoment);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
20
33
|
if (result.start.isOnlyDayMonthComponent() && refMoment.isAfter(result.start.dayjs())) {
|
|
21
34
|
for (let i = 0; i < 3 && refMoment.isAfter(result.start.dayjs()); i++) {
|
|
22
35
|
result.start.imply("year", result.start.get("year") + 1);
|
package/src/index.ts
CHANGED
|
@@ -117,7 +117,8 @@ import * as pt from "./locales/pt";
|
|
|
117
117
|
import * as nl from "./locales/nl";
|
|
118
118
|
import * as zh from "./locales/zh";
|
|
119
119
|
import * as ru from "./locales/ru";
|
|
120
|
-
|
|
120
|
+
import * as es from "./locales/es";
|
|
121
|
+
export { de, fr, ja, pt, nl, zh, ru, es };
|
|
121
122
|
|
|
122
123
|
/**
|
|
123
124
|
* A shortcut for {@link en | chrono.en.strict}
|
|
@@ -135,9 +135,11 @@ export const ORDINAL_WORD_DICTIONARY: { [word: string]: number } = {
|
|
|
135
135
|
};
|
|
136
136
|
|
|
137
137
|
export const TIME_UNIT_DICTIONARY: { [word: string]: OpUnitType | QUnitType } = {
|
|
138
|
+
s: "second",
|
|
138
139
|
sec: "second",
|
|
139
140
|
second: "second",
|
|
140
141
|
seconds: "second",
|
|
142
|
+
m: "minute",
|
|
141
143
|
min: "minute",
|
|
142
144
|
mins: "minute",
|
|
143
145
|
minute: "minute",
|
|
@@ -147,10 +149,14 @@ export const TIME_UNIT_DICTIONARY: { [word: string]: OpUnitType | QUnitType } =
|
|
|
147
149
|
hrs: "hour",
|
|
148
150
|
hour: "hour",
|
|
149
151
|
hours: "hour",
|
|
152
|
+
d: "d",
|
|
150
153
|
day: "d",
|
|
151
154
|
days: "d",
|
|
155
|
+
w: "w",
|
|
152
156
|
week: "week",
|
|
153
157
|
weeks: "week",
|
|
158
|
+
mo: "month",
|
|
159
|
+
mos: "month",
|
|
154
160
|
month: "month",
|
|
155
161
|
months: "month",
|
|
156
162
|
qtr: "quarter",
|
|
@@ -1,50 +1,28 @@
|
|
|
1
1
|
import { ParsingContext } from "../../../chrono";
|
|
2
|
-
import { Meridiem } from "../../../index";
|
|
3
2
|
import { AbstractParserWithWordBoundaryChecking } from "../../../common/parsers/AbstractParserWithWordBoundary";
|
|
4
|
-
import
|
|
5
|
-
import { assignTheNextDay } from "../../../utils/dayjs";
|
|
3
|
+
import * as casualReferences from "../../../common/casualReferences";
|
|
6
4
|
|
|
7
|
-
const PATTERN = /(?:this)?\s{0,3}(morning|afternoon|evening|night|midnight|noon)(?=\W|$)/i;
|
|
5
|
+
const PATTERN = /(?:this)?\s{0,3}(morning|afternoon|evening|night|midnight|midday|noon)(?=\W|$)/i;
|
|
8
6
|
|
|
9
7
|
export default class ENCasualTimeParser extends AbstractParserWithWordBoundaryChecking {
|
|
10
8
|
innerPattern() {
|
|
11
9
|
return PATTERN;
|
|
12
10
|
}
|
|
13
|
-
|
|
14
11
|
innerExtract(context: ParsingContext, match: RegExpMatchArray) {
|
|
15
|
-
const targetDate = dayjs(context.refDate);
|
|
16
|
-
const component = context.createParsingComponents();
|
|
17
|
-
|
|
18
12
|
switch (match[1].toLowerCase()) {
|
|
19
13
|
case "afternoon":
|
|
20
|
-
|
|
21
|
-
component.imply("hour", 15);
|
|
22
|
-
break;
|
|
23
|
-
|
|
14
|
+
return casualReferences.afternoon(context.reference);
|
|
24
15
|
case "evening":
|
|
25
16
|
case "night":
|
|
26
|
-
|
|
27
|
-
component.imply("hour", 20);
|
|
28
|
-
break;
|
|
29
|
-
|
|
17
|
+
return casualReferences.evening(context.reference);
|
|
30
18
|
case "midnight":
|
|
31
|
-
|
|
32
|
-
component.imply("hour", 0);
|
|
33
|
-
component.imply("minute", 0);
|
|
34
|
-
component.imply("second", 0);
|
|
35
|
-
break;
|
|
36
|
-
|
|
19
|
+
return casualReferences.midnight(context.reference);
|
|
37
20
|
case "morning":
|
|
38
|
-
|
|
39
|
-
component.imply("hour", 6);
|
|
40
|
-
break;
|
|
41
|
-
|
|
21
|
+
return casualReferences.morning(context.reference);
|
|
42
22
|
case "noon":
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
break;
|
|
23
|
+
case "midday":
|
|
24
|
+
return casualReferences.noon(context.reference);
|
|
46
25
|
}
|
|
47
|
-
|
|
48
|
-
return component;
|
|
26
|
+
return null;
|
|
49
27
|
}
|
|
50
28
|
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
export const WEEKDAY_DICTIONARY: { [word: string]: number } = {
|
|
2
|
+
"domingo": 0,
|
|
3
|
+
"dom": 0,
|
|
4
|
+
"lunes": 1,
|
|
5
|
+
"lun": 1,
|
|
6
|
+
"martes": 2,
|
|
7
|
+
"mar": 2,
|
|
8
|
+
"miércoles": 3,
|
|
9
|
+
"miercoles": 3,
|
|
10
|
+
"mié": 3,
|
|
11
|
+
"mie": 3,
|
|
12
|
+
"jueves": 4,
|
|
13
|
+
"jue": 4,
|
|
14
|
+
"viernes": 5,
|
|
15
|
+
"vie": 5,
|
|
16
|
+
"sábado": 6,
|
|
17
|
+
"sabado": 6,
|
|
18
|
+
"sáb": 6,
|
|
19
|
+
"sab": 6,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const MONTH_DICTIONARY: { [word: string]: number } = {
|
|
23
|
+
"enero": 1,
|
|
24
|
+
"ene": 1,
|
|
25
|
+
"ene.": 1,
|
|
26
|
+
"febrero": 2,
|
|
27
|
+
"feb": 2,
|
|
28
|
+
"feb.": 2,
|
|
29
|
+
"marzo": 3,
|
|
30
|
+
"mar": 3,
|
|
31
|
+
"mar.": 3,
|
|
32
|
+
"abril": 4,
|
|
33
|
+
"abr": 4,
|
|
34
|
+
"abr.": 4,
|
|
35
|
+
"mayo": 5,
|
|
36
|
+
"may": 5,
|
|
37
|
+
"may.": 5,
|
|
38
|
+
"junio": 6,
|
|
39
|
+
"jun": 6,
|
|
40
|
+
"jun.": 6,
|
|
41
|
+
"julio": 7,
|
|
42
|
+
"jul": 7,
|
|
43
|
+
"jul.": 7,
|
|
44
|
+
"agosto": 8,
|
|
45
|
+
"ago": 8,
|
|
46
|
+
"ago.": 8,
|
|
47
|
+
"septiembre": 9,
|
|
48
|
+
"setiembre": 9,
|
|
49
|
+
"sep": 9,
|
|
50
|
+
"sep.": 9,
|
|
51
|
+
"octubre": 10,
|
|
52
|
+
"oct": 10,
|
|
53
|
+
"oct.": 10,
|
|
54
|
+
"noviembre": 11,
|
|
55
|
+
"nov": 11,
|
|
56
|
+
"nov.": 11,
|
|
57
|
+
"diciembre": 12,
|
|
58
|
+
"dic": 12,
|
|
59
|
+
"dic.": 12,
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
//-----------------------------
|
|
63
|
+
// 88 p. Chr. n.
|
|
64
|
+
// 234 AC
|
|
65
|
+
export const YEAR_PATTERN = "[0-9]{1,4}(?![^\\s]\\d)(?:\\s*[a|d]\\.?\\s*c\\.?|\\s*a\\.?\\s*d\\.?)?";
|
|
66
|
+
export function parseYear(match: string): number {
|
|
67
|
+
if (match.match(/^[0-9]{1,4}$/)) {
|
|
68
|
+
let yearNumber = parseInt(match);
|
|
69
|
+
if (yearNumber < 100) {
|
|
70
|
+
if (yearNumber > 50) {
|
|
71
|
+
yearNumber = yearNumber + 1900;
|
|
72
|
+
} else {
|
|
73
|
+
yearNumber = yearNumber + 2000;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return yearNumber;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (match.match(/a\.?\s*c\.?/i)) {
|
|
80
|
+
match = match.replace(/a\.?\s*c\.?/i, "");
|
|
81
|
+
return -parseInt(match);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return parseInt(match);
|
|
85
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chrono components for Portuguese support (*parsers*, *refiners*, and *configuration*)
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { includeCommonConfiguration } from "../../configurations";
|
|
8
|
+
import { ParsedResult, ParsingOption } from "../../index";
|
|
9
|
+
import { Chrono, Configuration } from "../../chrono";
|
|
10
|
+
import SlashDateFormatParser from "../../common/parsers/SlashDateFormatParser";
|
|
11
|
+
import ESWeekdayParser from "./parsers/ESWeekdayParser";
|
|
12
|
+
import ESTimeExpressionParser from "./parsers/ESTimeExpressionParser";
|
|
13
|
+
import ESMergeDateTimeRefiner from "./refiners/ESMergeDateTimeRefiner";
|
|
14
|
+
import ESMergeDateRangeRefiner from "./refiners/ESMergeDateRangeRefiner";
|
|
15
|
+
import ESMonthNameLittleEndianParser from "./parsers/ESMonthNameLittleEndianParser";
|
|
16
|
+
import ESCasualDateParser from "./parsers/ESCasualDateParser";
|
|
17
|
+
import ESCasualTimeParser from "./parsers/ESCasualTimeParser";
|
|
18
|
+
|
|
19
|
+
// Shortcuts
|
|
20
|
+
export const casual = new Chrono(createCasualConfiguration());
|
|
21
|
+
export const strict = new Chrono(createConfiguration(true));
|
|
22
|
+
|
|
23
|
+
export function parse(text: string, ref?: Date, option?: ParsingOption): ParsedResult[] {
|
|
24
|
+
return casual.parse(text, ref, option);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function parseDate(text: string, ref?: Date, option?: ParsingOption): Date {
|
|
28
|
+
return casual.parseDate(text, ref, option);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @ignore (to be documented later)
|
|
33
|
+
*/
|
|
34
|
+
export function createCasualConfiguration(littleEndian = true): Configuration {
|
|
35
|
+
const option = createConfiguration(false, littleEndian);
|
|
36
|
+
option.parsers.push(new ESCasualDateParser());
|
|
37
|
+
option.parsers.push(new ESCasualTimeParser());
|
|
38
|
+
return option;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @ignore (to be documented later)
|
|
43
|
+
*/
|
|
44
|
+
export function createConfiguration(strictMode = true, littleEndian = true): Configuration {
|
|
45
|
+
return includeCommonConfiguration(
|
|
46
|
+
{
|
|
47
|
+
parsers: [
|
|
48
|
+
new SlashDateFormatParser(littleEndian),
|
|
49
|
+
new ESWeekdayParser(),
|
|
50
|
+
new ESTimeExpressionParser(),
|
|
51
|
+
new ESMonthNameLittleEndianParser(),
|
|
52
|
+
],
|
|
53
|
+
refiners: [new ESMergeDateTimeRefiner(), new ESMergeDateRangeRefiner()],
|
|
54
|
+
},
|
|
55
|
+
strictMode
|
|
56
|
+
);
|
|
57
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ParsingContext } from "../../../chrono";
|
|
2
|
+
import { ParsingComponents, ParsingResult } from "../../../results";
|
|
3
|
+
import { AbstractParserWithWordBoundaryChecking } from "../../../common/parsers/AbstractParserWithWordBoundary";
|
|
4
|
+
import * as references from "../../../common/casualReferences";
|
|
5
|
+
|
|
6
|
+
export default class ESCasualDateParser extends AbstractParserWithWordBoundaryChecking {
|
|
7
|
+
innerPattern(context: ParsingContext): RegExp {
|
|
8
|
+
return /(ahora|hoy|mañana|ayer)(?=\W|$)/i;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
innerExtract(context: ParsingContext, match: RegExpMatchArray): ParsingComponents | ParsingResult {
|
|
12
|
+
const lowerText = match[0].toLowerCase();
|
|
13
|
+
const component = context.createParsingComponents();
|
|
14
|
+
|
|
15
|
+
switch (lowerText) {
|
|
16
|
+
case "ahora":
|
|
17
|
+
return references.now(context.reference);
|
|
18
|
+
|
|
19
|
+
case "hoy":
|
|
20
|
+
return references.today(context.reference);
|
|
21
|
+
|
|
22
|
+
case "mañana":
|
|
23
|
+
return references.tomorrow(context.reference);
|
|
24
|
+
|
|
25
|
+
case "ayer":
|
|
26
|
+
return references.yesterday(context.reference);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return component;
|
|
30
|
+
}
|
|
31
|
+
}
|