Skip to content

Commit

Permalink
Added support for "annualy" case
Browse files Browse the repository at this point in the history
  • Loading branch information
alordash committed Oct 5, 2021
1 parent b9852aa commit ec59f49
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/date-cases/parse-cases/common-parse-cases.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,18 @@ const parseCases = [
parsedTimes.push(new ParsedTime(DateTypes.target, TimeTypes.months, month, indexes, context, prevalence, { validMode: ValidModes.certified }));
}
return parsedTimes;
}),
//Searchs for 'Annualy' case
new ParseCase(50, function (parsedTimes, contextsData, prevalence) {
let matches = [...this.regchars.matchAll(/J/g)];
for (const match of matches) {

let indexes = markIndexes.call(this, match.index, 1, false, false);
let context = processContexts(contextsData, indexes);

parsedTimes.push(new ParsedTime(DateTypes.period, TimeTypes.years, 1, indexes, context, prevalence, { validMode: ValidModes.certified }));
}
return parsedTimes;
})
];

Expand Down

0 comments on commit ec59f49

Please sign in to comment.