chayns-components
Version:
A set of beautiful React components for developing chayns® applications.
23 lines (21 loc) • 669 B
JavaScript
;
exports.__esModule = true;
exports.default = validateOpeningTimes;
var _validateDay = require("./validateDay");
function validateOpeningTimes(openingTimes) {
const openingTimesByDay = {};
openingTimes.forEach(openingTime => {
if (!openingTimesByDay[openingTime.weekDay]) {
openingTimesByDay[openingTime.weekDay] = [];
}
openingTimesByDay[openingTime.weekDay].push(openingTime);
});
const days = Object.values(openingTimesByDay);
for (let i = 0, z = days.length; i < z; i += 1) {
if (!(0, _validateDay.validateDay)(days[i])) {
return false;
}
}
return true;
}
//# sourceMappingURL=validateOpeningTimes.js.map