Skip to content

Commit

Permalink
fix: 🐛 fix today's task always overdue
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenull committed Mar 15, 2022
1 parent 3c36f40 commit 186d2cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util/util.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { addHours, addMinutes, endOfDay, format, formatISO, isAfter, parse, parseISO } from 'date-fns'
import { addHours, addMinutes, endOfDay, format, formatISO, isAfter, parse, parseISO, startOfDay } from 'date-fns'
import { flattenDeep, get } from 'lodash'
// import en from 'dayjs/locale/en'
import { ISchedule } from 'tui-calendar'
Expand Down Expand Up @@ -274,7 +274,7 @@ export const getWeekly = async (startDate, endDate) => {
*/
export const isOverdue = (block: any, date: string) => {
if (block.marker && block.marker !== 'DONE') {
return isAfter(new Date(), parseISO(date))
return isAfter(startOfDay(new Date()), parseISO(date))
}
// 非 todo 及 done 的 block 不过期
return false
Expand Down

0 comments on commit 186d2cf

Please sign in to comment.