【发布时间】:2019-10-02 12:44:50
【问题描述】:
我有一个小问题,我想知道哪个是最佳解决方案。 所以基本上我有一个带有“开始”和“结束”属性的表格。
我想将每一行放在我的数组中,其中“开始”日期在当天。 所以我的计划是通过使用 Axios、Sequelize 和 PostgreSQL 来做到这一点:
axios.get('http://localhost:3030/worktimes/', {
/*
params: {
Start: moment(new Date()) //here I just want to compare the actual date and not Date + Time
}
*/
})
.then(response => {
this.worktimes = response.data.data;
console.log(JSON.stringify(this.worktimes));
})
.catch((error) => {
console.log(error.data);
});
我正在使用 moment.js,但直到现在我才知道如何将这种智能用于我的案例。如果您也没有更好的主意,我会在我的数组中获取所有内容并尝试删除“日期时间”的时间部分,但这似乎太复杂了。
【问题讨论】:
标签: javascript postgresql vue.js momentjs