Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
hrsMinsParser.extract = (text, ref, match, opt) => {
let dateMoment = require('moment')(ref);
dateMoment = dateMoment.add(match[1], 'hours');
dateMoment = dateMoment.add(match[3], 'minutes');
return new chrono.ParsedResult({
ref: ref,
text: match[0],
index: match.index,
start: {
hour: dateMoment.hour(),
minute: dateMoment.minute(),
second: dateMoment.second(),
day: dateMoment.date(),
month: dateMoment.month() + 1,
year: dateMoment.year(),
}
});
};