chrono-node 2.3.9 → 2.4.2
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 +320 -0
- package/README.md +1 -1
- package/benchmark/results/chrono.chart.html +111 -0
- package/coverage/clover.xml +4589 -0
- package/coverage/coverage-final.json +138 -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 +641 -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 +412 -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 +517 -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 +841 -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 +238 -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/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 +7750 -0
- package/dist/chrono.js.map +1 -1
- package/dist/common/calculation/weekdays.d.ts +7 -0
- package/dist/common/calculation/weekdays.js +68 -0
- package/dist/common/calculation/weekdays.js.map +1 -0
- 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 +9 -0
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/locales/de/parsers/DEWeekdayParser.js +2 -8
- package/dist/locales/de/parsers/DEWeekdayParser.js.map +1 -1
- package/dist/locales/en/constants.d.ts +2 -1
- package/dist/locales/en/constants.js.map +1 -1
- package/dist/locales/en/parsers/ENCasualTimeParser.js +4 -4
- package/dist/locales/en/parsers/ENCasualTimeParser.js.map +1 -1
- package/dist/locales/en/parsers/ENWeekdayParser.js +3 -9
- package/dist/locales/en/parsers/ENWeekdayParser.js.map +1 -1
- package/dist/locales/fr/parsers/FRWeekdayParser.js +4 -10
- package/dist/locales/fr/parsers/FRWeekdayParser.js.map +1 -1
- package/dist/locales/nl/parsers/NLWeekdayParser.js +3 -9
- package/dist/locales/nl/parsers/NLWeekdayParser.js.map +1 -1
- package/dist/locales/pt/parsers/PTWeekdayParser.js +4 -10
- package/dist/locales/pt/parsers/PTWeekdayParser.js.map +1 -1
- package/dist/locales/ru/constants.js +4 -5
- package/dist/locales/ru/constants.js.map +1 -1
- package/dist/locales/ru/parsers/RUWeekdayParser.js +3 -9
- package/dist/locales/ru/parsers/RUWeekdayParser.js.map +1 -1
- package/dist/locales/ru/refiners/RUMergeDateRangeRefiner.d.ts +1 -1
- package/dist/locales/ru/refiners/RUMergeDateRangeRefiner.js +2 -2
- package/dist/locales/ru/refiners/RUMergeDateRangeRefiner.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/results.d.ts +2 -1
- package/dist/results.js +14 -10
- package/dist/results.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/chrono.ts +3 -1
- package/src/common/calculation/weekdays.ts +89 -0
- 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 +10 -0
- package/src/locales/de/parsers/DEWeekdayParser.ts +2 -8
- package/src/locales/en/constants.ts +2 -1
- package/src/locales/en/parsers/ENCasualTimeParser.ts +6 -5
- package/src/locales/en/parsers/ENWeekdayParser.ts +3 -9
- package/src/locales/fr/parsers/FRWeekdayParser.ts +4 -10
- package/src/locales/nl/parsers/NLWeekdayParser.ts +3 -9
- package/src/locales/pt/parsers/PTWeekdayParser.ts +4 -10
- package/src/locales/ru/constants.ts +4 -6
- package/src/locales/ru/parsers/RUWeekdayParser.ts +3 -9
- package/src/locales/ru/refiners/RUMergeDateRangeRefiner.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/results.ts +27 -15
- package/src/utils/dayjs.ts +12 -0
- package/test/calculation.test.ts +116 -0
- package/test/en/en.test.ts +10 -0
- package/test/en/en_casual.test.ts +7 -0
- package/test/en/en_slash.test.ts +12 -11
- package/test/en/en_time_exp.test.ts +53 -0
- package/test/en/en_weekday.test.ts +116 -1
- package/test/en/negative_cases.test.ts +11 -0
- package/test/zh/zh_hans_time_exp.test.ts +15 -0
- package/test/zh/zh_hant_time_exp.test.ts +14 -0
- package/src/calculation/weeks.ts +0 -38
|
@@ -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
package/src/chrono.ts
CHANGED
|
@@ -140,7 +140,9 @@ export class ParsingContext implements DebugHandler {
|
|
|
140
140
|
readonly option: ParsingOption;
|
|
141
141
|
readonly reference: ReferenceWithTimezone;
|
|
142
142
|
|
|
143
|
-
|
|
143
|
+
/**
|
|
144
|
+
* @deprecated. Use reference.instant instead.
|
|
145
|
+
*/
|
|
144
146
|
readonly refDate: Date;
|
|
145
147
|
|
|
146
148
|
constructor(text: string, refDate?: ParsingReference | Date, option?: ParsingOption) {
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Weekday } from "../../index";
|
|
2
|
+
import { ParsingComponents, ReferenceWithTimezone } from "../../results";
|
|
3
|
+
import { addImpliedTimeUnits } from "../../utils/timeunits";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Returns the parsing components at the weekday (considering the modifier). The time and timezone is assume to be
|
|
7
|
+
* similar to the reference.
|
|
8
|
+
* @param reference
|
|
9
|
+
* @param weekday
|
|
10
|
+
* @param modifier "this", "next", "last" modifier word. If empty, returns the weekday closest to the `refDate`.
|
|
11
|
+
*/
|
|
12
|
+
export function createParsingComponentsAtWeekday(
|
|
13
|
+
reference: ReferenceWithTimezone,
|
|
14
|
+
weekday: Weekday,
|
|
15
|
+
modifier?: "this" | "next" | "last"
|
|
16
|
+
): ParsingComponents {
|
|
17
|
+
const refDate = reference.getDateWithAdjustedTimezone();
|
|
18
|
+
const daysToWeekday = getDaysToWeekday(refDate, weekday, modifier);
|
|
19
|
+
|
|
20
|
+
let components = new ParsingComponents(reference);
|
|
21
|
+
components = addImpliedTimeUnits(components, { "day": daysToWeekday });
|
|
22
|
+
components.assign("weekday", weekday);
|
|
23
|
+
|
|
24
|
+
return components;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Returns number of days from refDate to the weekday. The refDate date and timezone information is used.
|
|
29
|
+
* @param refDate
|
|
30
|
+
* @param weekday
|
|
31
|
+
* @param modifier "this", "next", "last" modifier word. If empty, returns the weekday closest to the `refDate`.
|
|
32
|
+
*/
|
|
33
|
+
export function getDaysToWeekday(refDate: Date, weekday: Weekday, modifier?: "this" | "next" | "last"): number {
|
|
34
|
+
const refWeekday = refDate.getDay() as Weekday;
|
|
35
|
+
switch (modifier) {
|
|
36
|
+
case "this":
|
|
37
|
+
return getDaysForwardToWeekday(refDate, weekday);
|
|
38
|
+
case "last":
|
|
39
|
+
return getBackwardDaysToWeekday(refDate, weekday);
|
|
40
|
+
case "next":
|
|
41
|
+
// From Sunday, the next Sunday is 7 days later.
|
|
42
|
+
// Otherwise, next Mon is 1 days later, next Tues is 2 days later, and so on..., (return enum value)
|
|
43
|
+
if (refWeekday == Weekday.SUNDAY) {
|
|
44
|
+
return weekday == Weekday.SUNDAY ? 7 : weekday;
|
|
45
|
+
}
|
|
46
|
+
// From Saturday, the next Saturday is 7 days later, the next Sunday is 8-days later.
|
|
47
|
+
// Otherwise, next Mon is (1 + 1) days later, next Tues is (1 + 2) days later, and so on...,
|
|
48
|
+
// (return, 2 + [enum value] days)
|
|
49
|
+
if (refWeekday == Weekday.SATURDAY) {
|
|
50
|
+
if (weekday == Weekday.SATURDAY) return 7;
|
|
51
|
+
if (weekday == Weekday.SUNDAY) return 8;
|
|
52
|
+
return 1 + weekday;
|
|
53
|
+
}
|
|
54
|
+
// From weekdays, next Mon is the following week's Mon, next Tues the following week's Tues, and so on...
|
|
55
|
+
// If the week's weekday already passed (weekday < refWeekday), we simply count forward to next week
|
|
56
|
+
// (similar to 'this'). Otherwise, count forward to this week, then add another 7 days.
|
|
57
|
+
if (weekday < refWeekday && weekday != Weekday.SUNDAY) {
|
|
58
|
+
return getDaysForwardToWeekday(refDate, weekday);
|
|
59
|
+
} else {
|
|
60
|
+
return getDaysForwardToWeekday(refDate, weekday) + 7;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return getDaysToWeekdayClosest(refDate, weekday);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function getDaysToWeekdayClosest(refDate: Date, weekday: Weekday): number {
|
|
67
|
+
const backward = getBackwardDaysToWeekday(refDate, weekday);
|
|
68
|
+
const forward = getDaysForwardToWeekday(refDate, weekday);
|
|
69
|
+
|
|
70
|
+
return forward < -backward ? forward : backward;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function getDaysForwardToWeekday(refDate: Date, weekday: Weekday): number {
|
|
74
|
+
const refWeekday = refDate.getDay();
|
|
75
|
+
let forwardCount = weekday - refWeekday;
|
|
76
|
+
if (forwardCount < 0) {
|
|
77
|
+
forwardCount += 7;
|
|
78
|
+
}
|
|
79
|
+
return forwardCount;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function getBackwardDaysToWeekday(refDate: Date, weekday: Weekday): number {
|
|
83
|
+
const refWeekday = refDate.getDay();
|
|
84
|
+
let backwardCount = weekday - refWeekday;
|
|
85
|
+
if (backwardCount >= 0) {
|
|
86
|
+
backwardCount -= 7;
|
|
87
|
+
}
|
|
88
|
+
return backwardCount;
|
|
89
|
+
}
|
|
@@ -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
|
@@ -99,6 +99,16 @@ export enum Meridiem {
|
|
|
99
99
|
PM = 1,
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
+
export enum Weekday {
|
|
103
|
+
SUNDAY = 0,
|
|
104
|
+
MONDAY = 1,
|
|
105
|
+
TUESDAY = 2,
|
|
106
|
+
WEDNESDAY = 3,
|
|
107
|
+
THURSDAY = 4,
|
|
108
|
+
FRIDAY = 5,
|
|
109
|
+
SATURDAY = 6,
|
|
110
|
+
}
|
|
111
|
+
|
|
102
112
|
// Export all locales
|
|
103
113
|
import * as de from "./locales/de";
|
|
104
114
|
import * as fr from "./locales/fr";
|
|
@@ -3,7 +3,7 @@ import { ParsingComponents } from "../../../results";
|
|
|
3
3
|
import { WEEKDAY_DICTIONARY } from "../constants";
|
|
4
4
|
import { matchAnyPattern } from "../../../utils/pattern";
|
|
5
5
|
import { AbstractParserWithWordBoundaryChecking } from "../../../common/parsers/AbstractParserWithWordBoundary";
|
|
6
|
-
import {
|
|
6
|
+
import { createParsingComponentsAtWeekday } from "../../../common/calculation/weekdays";
|
|
7
7
|
|
|
8
8
|
const PATTERN = new RegExp(
|
|
9
9
|
"(?:(?:\\,|\\(|\\()\\s*)?" +
|
|
@@ -44,12 +44,6 @@ export default class DEWeekdayParser extends AbstractParserWithWordBoundaryCheck
|
|
|
44
44
|
modifier = "this";
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
return context
|
|
49
|
-
.createParsingComponents()
|
|
50
|
-
.assign("weekday", offset)
|
|
51
|
-
.imply("day", date.date())
|
|
52
|
-
.imply("month", date.month() + 1)
|
|
53
|
-
.imply("year", date.year());
|
|
47
|
+
return createParsingComponentsAtWeekday(context.reference, offset, modifier);
|
|
54
48
|
}
|
|
55
49
|
}
|
|
@@ -2,8 +2,9 @@ import { OpUnitType, QUnitType } from "dayjs";
|
|
|
2
2
|
import { matchAnyPattern, repeatedTimeunitPattern } from "../../utils/pattern";
|
|
3
3
|
import { findMostLikelyADYear } from "../../calculation/years";
|
|
4
4
|
import { TimeUnits } from "../../utils/timeunits";
|
|
5
|
+
import { Weekday } from "../../index";
|
|
5
6
|
|
|
6
|
-
export const WEEKDAY_DICTIONARY: { [word: string]:
|
|
7
|
+
export const WEEKDAY_DICTIONARY: { [word: string]: Weekday } = {
|
|
7
8
|
sunday: 0,
|
|
8
9
|
sun: 0,
|
|
9
10
|
"sun.": 0,
|
|
@@ -2,7 +2,8 @@ import { ParsingContext } from "../../../chrono";
|
|
|
2
2
|
import { Meridiem } from "../../../index";
|
|
3
3
|
import { AbstractParserWithWordBoundaryChecking } from "../../../common/parsers/AbstractParserWithWordBoundary";
|
|
4
4
|
import dayjs from "dayjs";
|
|
5
|
-
import {
|
|
5
|
+
import { implyTheNextDay } from "../../../utils/dayjs";
|
|
6
|
+
import { midnight } from "../../../common/casualReferences";
|
|
6
7
|
|
|
7
8
|
const PATTERN = /(?:this)?\s{0,3}(morning|afternoon|evening|night|midnight|noon)(?=\W|$)/i;
|
|
8
9
|
|
|
@@ -28,10 +29,10 @@ export default class ENCasualTimeParser extends AbstractParserWithWordBoundaryCh
|
|
|
28
29
|
break;
|
|
29
30
|
|
|
30
31
|
case "midnight":
|
|
31
|
-
|
|
32
|
-
component.
|
|
33
|
-
component.
|
|
34
|
-
component.
|
|
32
|
+
implyTheNextDay(component, targetDate);
|
|
33
|
+
component.assign("hour", 0);
|
|
34
|
+
component.assign("minute", 0);
|
|
35
|
+
component.assign("second", 0);
|
|
35
36
|
break;
|
|
36
37
|
|
|
37
38
|
case "morning":
|
|
@@ -3,7 +3,7 @@ import { ParsingComponents } from "../../../results";
|
|
|
3
3
|
import { WEEKDAY_DICTIONARY } from "../constants";
|
|
4
4
|
import { matchAnyPattern } from "../../../utils/pattern";
|
|
5
5
|
import { AbstractParserWithWordBoundaryChecking } from "../../../common/parsers/AbstractParserWithWordBoundary";
|
|
6
|
-
import {
|
|
6
|
+
import { createParsingComponentsAtWeekday } from "../../../common/calculation/weekdays";
|
|
7
7
|
|
|
8
8
|
const PATTERN = new RegExp(
|
|
9
9
|
"(?:(?:\\,|\\(|\\()\\s*)?" +
|
|
@@ -27,7 +27,7 @@ export default class ENWeekdayParser extends AbstractParserWithWordBoundaryCheck
|
|
|
27
27
|
|
|
28
28
|
innerExtract(context: ParsingContext, match: RegExpMatchArray): ParsingComponents {
|
|
29
29
|
const dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();
|
|
30
|
-
const
|
|
30
|
+
const weekday = WEEKDAY_DICTIONARY[dayOfWeek];
|
|
31
31
|
const prefix = match[PREFIX_GROUP];
|
|
32
32
|
const postfix = match[POSTFIX_GROUP];
|
|
33
33
|
let modifierWord = prefix || postfix;
|
|
@@ -43,12 +43,6 @@ export default class ENWeekdayParser extends AbstractParserWithWordBoundaryCheck
|
|
|
43
43
|
modifier = "this";
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
return context
|
|
48
|
-
.createParsingComponents()
|
|
49
|
-
.assign("weekday", offset)
|
|
50
|
-
.imply("day", date.date())
|
|
51
|
-
.imply("month", date.month() + 1)
|
|
52
|
-
.imply("year", date.year());
|
|
46
|
+
return createParsingComponentsAtWeekday(context.reference, weekday, modifier);
|
|
53
47
|
}
|
|
54
48
|
}
|
|
@@ -3,7 +3,7 @@ import { ParsingComponents } from "../../../results";
|
|
|
3
3
|
import { WEEKDAY_DICTIONARY } from "../constants";
|
|
4
4
|
import { matchAnyPattern } from "../../../utils/pattern";
|
|
5
5
|
import { AbstractParserWithWordBoundaryChecking } from "../../../common/parsers/AbstractParserWithWordBoundary";
|
|
6
|
-
import {
|
|
6
|
+
import { createParsingComponentsAtWeekday } from "../../../common/calculation/weekdays";
|
|
7
7
|
|
|
8
8
|
const PATTERN = new RegExp(
|
|
9
9
|
"(?:(?:\\,|\\(|\\()\\s*)?" +
|
|
@@ -25,8 +25,8 @@ export default class FRWeekdayParser extends AbstractParserWithWordBoundaryCheck
|
|
|
25
25
|
|
|
26
26
|
innerExtract(context: ParsingContext, match: RegExpMatchArray): ParsingComponents {
|
|
27
27
|
const dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
28
|
+
const weekday = WEEKDAY_DICTIONARY[dayOfWeek];
|
|
29
|
+
if (weekday === undefined) {
|
|
30
30
|
return null;
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -41,12 +41,6 @@ export default class FRWeekdayParser extends AbstractParserWithWordBoundaryCheck
|
|
|
41
41
|
modifier = "next";
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
return context
|
|
46
|
-
.createParsingComponents()
|
|
47
|
-
.assign("weekday", offset)
|
|
48
|
-
.imply("day", date.date())
|
|
49
|
-
.imply("month", date.month() + 1)
|
|
50
|
-
.imply("year", date.year());
|
|
44
|
+
return createParsingComponentsAtWeekday(context.reference, weekday, modifier);
|
|
51
45
|
}
|
|
52
46
|
}
|
|
@@ -3,7 +3,7 @@ import { ParsingComponents } from "../../../results";
|
|
|
3
3
|
import { WEEKDAY_DICTIONARY } from "../../nl/constants";
|
|
4
4
|
import { matchAnyPattern } from "../../../utils/pattern";
|
|
5
5
|
import { AbstractParserWithWordBoundaryChecking } from "../../../common/parsers/AbstractParserWithWordBoundary";
|
|
6
|
-
import {
|
|
6
|
+
import { createParsingComponentsAtWeekday } from "../../../common/calculation/weekdays";
|
|
7
7
|
|
|
8
8
|
const PATTERN = new RegExp(
|
|
9
9
|
"(?:(?:\\,|\\(|\\()\\s*)?" +
|
|
@@ -25,7 +25,7 @@ export default class NLWeekdayParser extends AbstractParserWithWordBoundaryCheck
|
|
|
25
25
|
|
|
26
26
|
innerExtract(context: ParsingContext, match: RegExpMatchArray): ParsingComponents {
|
|
27
27
|
const dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();
|
|
28
|
-
const
|
|
28
|
+
const weekday = WEEKDAY_DICTIONARY[dayOfWeek];
|
|
29
29
|
const prefix = match[PREFIX_GROUP];
|
|
30
30
|
const postfix = match[POSTFIX_GROUP];
|
|
31
31
|
let modifierWord = prefix || postfix;
|
|
@@ -41,12 +41,6 @@ export default class NLWeekdayParser extends AbstractParserWithWordBoundaryCheck
|
|
|
41
41
|
modifier = "this";
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
return context
|
|
46
|
-
.createParsingComponents()
|
|
47
|
-
.assign("weekday", offset)
|
|
48
|
-
.imply("day", date.date())
|
|
49
|
-
.imply("month", date.month() + 1)
|
|
50
|
-
.imply("year", date.year());
|
|
44
|
+
return createParsingComponentsAtWeekday(context.reference, weekday, modifier);
|
|
51
45
|
}
|
|
52
46
|
}
|
|
@@ -3,7 +3,7 @@ import { ParsingComponents } from "../../../results";
|
|
|
3
3
|
import { WEEKDAY_DICTIONARY } from "../constants";
|
|
4
4
|
import { matchAnyPattern } from "../../../utils/pattern";
|
|
5
5
|
import { AbstractParserWithWordBoundaryChecking } from "../../../common/parsers/AbstractParserWithWordBoundary";
|
|
6
|
-
import {
|
|
6
|
+
import { createParsingComponentsAtWeekday } from "../../../common/calculation/weekdays";
|
|
7
7
|
|
|
8
8
|
const PATTERN = new RegExp(
|
|
9
9
|
"(?:(?:\\,|\\(|\\()\\s*)?" +
|
|
@@ -26,8 +26,8 @@ export default class PTWeekdayParser extends AbstractParserWithWordBoundaryCheck
|
|
|
26
26
|
|
|
27
27
|
innerExtract(context: ParsingContext, match: RegExpMatchArray): ParsingComponents {
|
|
28
28
|
const dayOfWeek = match[WEEKDAY_GROUP].toLowerCase();
|
|
29
|
-
const
|
|
30
|
-
if (
|
|
29
|
+
const weekday = WEEKDAY_DICTIONARY[dayOfWeek];
|
|
30
|
+
if (weekday === undefined) {
|
|
31
31
|
return null;
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -45,12 +45,6 @@ export default class PTWeekdayParser extends AbstractParserWithWordBoundaryCheck
|
|
|
45
45
|
modifier = "this";
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
return context
|
|
50
|
-
.createParsingComponents()
|
|
51
|
-
.assign("weekday", offset)
|
|
52
|
-
.imply("day", date.date())
|
|
53
|
-
.imply("month", date.month() + 1)
|
|
54
|
-
.imply("year", date.year());
|
|
48
|
+
return createParsingComponentsAtWeekday(context.reference, weekday, modifier);
|
|
55
49
|
}
|
|
56
50
|
}
|