Archived
1
0
Fork 0

Disable order for the current day

This commit is contained in:
Ethanell 2020-09-30 11:57:28 +02:00
parent 372c788396
commit 085ae08b74
2 changed files with 2 additions and 0 deletions

View file

@ -4,6 +4,7 @@ let models = require("../models");
router.get("/", async (req, res) => { router.get("/", async (req, res) => {
let now = new Date(); let now = new Date();
now.setDate(now.getDate()+1);
let [firstDate, lastDate] = [await models.Data.findByPk("firstDate"), let [firstDate, lastDate] = [await models.Data.findByPk("firstDate"),
await models.Data.findByPk("lastDate")]; await models.Data.findByPk("lastDate")];

View file

@ -30,6 +30,7 @@ module.exports = async (req, res, args, dateCheck = true) => {
let [firstDate, lastDate] = [await models.Data.findByPk("firstDate"), let [firstDate, lastDate] = [await models.Data.findByPk("firstDate"),
await models.Data.findByPk("lastDate")]; await models.Data.findByPk("lastDate")];
let now = new Date(); let now = new Date();
now.setDate(now.getDate()+1);
now.setUTCHours(0, 0, 0, 0); now.setUTCHours(0, 0, 0, 0);
if (firstDate && firstDate.value && lastDate && lastDate.value) { if (firstDate && firstDate.value && lastDate && lastDate.value) {