voucher-validator
Version:
This lib provide validator to check business rules for a voucher
12 lines • 505 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
function IsNotExpired(voucher) {
const currentDate = new Date();
const endDate = new Date(voucher.dataFimValidade);
// Obter a data sem hora
const currentDateWithoutTime = new Date(currentDate.toDateString());
const endDateWithoutTime = new Date(endDate.toDateString());
return currentDateWithoutTime <= endDateWithoutTime;
}
exports.default = IsNotExpired;
//# sourceMappingURL=is-expired-voucher.js.map