You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
v2.0.2: fix Things packed-date / Unix-epoch decoding
startDate/deadline are bit-packed calendar dates (not Unix seconds) and
stopDate/creationDate are Unix seconds (not Cocoa). The old code had both
backwards, so today counted recurrence templates via todayIndex>0, due/
overdue/upcoming were silently empty, and completedToday counted all-time
completions. Add decode/encode helpers, redefine Today by scheduled date,
rebuild the fixture with real encodings, and add a regression test.
AND (todayIndex > 0 OR (startDate >= 1000000000 AND startDate < ?))
17
-
`,bounds.end),
17
+
AND start = 1 AND startDate IS NOT NULL AND startDate > 0 AND startDate < ?
18
+
`,tomorrow),
18
19
inbox: q(`SELECT COUNT(*) as count FROM TMTask WHERE status=0 AND trashed=0 AND type=0 AND start=0`),
19
20
anytime: q(`
20
21
SELECT COUNT(*) as count FROM TMTask
@@ -23,13 +24,13 @@ function _gather(database) {
23
24
someday: q(`
24
25
SELECT COUNT(*) as count FROM TMTask
25
26
WHERE status=0 AND trashed=0 AND type=0 AND start=2 AND todayIndex<=0
26
-
AND (startDate IS NULL OR startDate < 1000000000)
27
+
AND startDate IS NULL
27
28
`),
28
-
upcoming: q(`SELECT COUNT(*) as count FROM TMTask WHERE status=0 AND trashed=0 AND type=0 AND startDate >= ?`,bounds.end),
29
+
upcoming: q(`SELECT COUNT(*) as count FROM TMTask WHERE status=0 AND trashed=0 AND type=0 AND startDate IS NOT NULL AND startDate >= ? AND todayIndex<=0`,tomorrow),
29
30
evening: q(`SELECT COUNT(*) as count FROM TMTask WHERE status=0 AND trashed=0 AND type=0 AND startBucket=1 AND todayIndex<=0`),
30
-
overdue: q(`SELECT COUNT(*) as count FROM TMTask WHERE status=0 AND trashed=0 AND type=0 AND deadline > 1000000000 AND deadline < ?`,bounds.start),
31
+
overdue: q(`SELECT COUNT(*) as count FROM TMTask WHERE status=0 AND trashed=0 AND type=0 AND deadline IS NOT NULL AND deadline > 0 AND deadline < ?`,today),
31
32
totalOpen: q(`SELECT COUNT(*) as count FROM TMTask WHERE status=0 AND trashed=0 AND type=0`),
32
-
completedToday: q(`SELECT COUNT(*) as count FROM TMTask WHERE status=3 AND trashed=0 AND type=0 AND stopDate >= ?`,cocoaTodayStart),
33
+
completedToday: q(`SELECT COUNT(*) as count FROM TMTask WHERE status=3 AND trashed=0 AND type=0 AND stopDate >= ?`,bounds.start),
33
34
projects: q(`SELECT COUNT(*) as count FROM TMTask WHERE status=0 AND trashed=0 AND type=1`),
0 commit comments