Commit e944a239 authored by Gavin Peng's avatar Gavin Peng

fix: 修复新增编辑逻辑判断

parent 00ff3228
......@@ -115,9 +115,8 @@ const disabledDate = (current: moment.Moment) => {
return current && current < moment().startOf('day')
}
const yesterday = new Date(new Date().setDate(new Date().getDate() - 1))
const year = new Date().getFullYear()
const today = yesterday.getTime()
const yesterday = new Date(new Date().setDate(new Date().getDate() - 1)).getTime()
/**
* 判断是否在今天之前,不包含今天
* - 例:today = 2022-04-18,2022-04-18之前但是不包含今天返回 true
......@@ -125,7 +124,7 @@ const today = yesterday.getTime()
*/
const afterToday = (day: string) => {
// return new Date(`${year}-${day}`).getTime() < today // 包含今天判断
return new Date(`${year}-${day}`).getTime() < today
return new Date(`${year}-${day}`).getTime() < yesterday
}
export {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment