Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
if (pastDate >= referenceDate) {
pastDate.setDate(value.getDate() - 7);
}
result.futureValue = futureDate;
result.pastValue = pastDate;
result.success = true;
return result;
}
// handle "for the 27th."
match = RegExpUtility.getMatches(this.config.forTheRegex, trimmedSource).pop();
if (match) {
let dayStr = match.groups('DayOfMonth').value;
let er = ExtractResult.getFromText(dayStr);
let day = Number.parseInt(this.config.numberParser.parse(er).value);
let month = referenceDate.getMonth();
let year = referenceDate.getFullYear();
result.timex = DateTimeFormatUtil.luisDate(-1, -1, day);
let date = new Date(year, month, day);
result.futureValue = date;
result.pastValue = date;
result.success = true;
return result;
}
// handling cases like 'Thursday the 21st', which both 'Thursday' and '21st' refer to a same date
match = RegExpUtility.getMatches(this.config.weekDayAndDayOfMonthRegex, trimmedSource).pop();