File tree Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,7 @@ data Command
115
115
| ListNew
116
116
| ListOld
117
117
| ListOpen
118
+ | ListModified
118
119
| ListDone
119
120
| ListObsolete
120
121
| ListDeletable
@@ -462,6 +463,9 @@ commandParser conf =
462
463
463
464
<> command " open" (toParserInfo (pure ListOpen )
464
465
" List all open tasks by priority desc" )
466
+
467
+ <> command " modified" (toParserInfo (pure ListModified )
468
+ " List all modified tasks by modified_utc desc" )
465
469
466
470
-- All tasks due to no later than
467
471
-- <> command "yesterday"
@@ -853,6 +857,7 @@ executeCLiCommand conf now connection cmd =
853
857
ListNew -> newTasks conf now connection
854
858
ListOld -> listOldTasks conf now connection
855
859
ListOpen -> openTasks conf now connection
860
+ ListModified -> modifiedTasks conf now connection
856
861
ListOverdue -> overdueTasks conf now connection
857
862
ListRepeating -> listRepeating conf now connection
858
863
ListRecurring -> listRecurring conf now connection
Original file line number Diff line number Diff line change @@ -1571,6 +1571,24 @@ openTasks conf now connection = do
1571
1571
\order by `priority` desc"
1572
1572
pure $ formatTasks conf now tasks
1573
1573
1574
+ modifiedTasks :: Config -> DateTime -> Connection -> IO (Doc AnsiStyle )
1575
+ modifiedTasks conf now connection = do
1576
+ tasks <- query_ connection $ Query
1577
+ " select * from `tasks_view` \
1578
+ \order by `modified_utc` desc"
1579
+ pure $ formatTasks conf now $ filterModified tasks
1580
+ where
1581
+ filterModified =
1582
+ P. filter (\ task ->
1583
+ (removeNSec $ ulidTextToDateTime $ FullTask. ulid task)
1584
+ /= (parseUtc $ FullTask. modified_utc task))
1585
+ removeNSec :: Maybe DateTime -> Maybe DateTime
1586
+ removeNSec mDateTime =
1587
+ case mDateTime of
1588
+ Just dateTime -> Just $ dateTime { dtTime = (dtTime dateTime) { todNSec = 0 } }
1589
+ Nothing -> Nothing
1590
+
1591
+
1574
1592
1575
1593
overdueTasks :: Config -> DateTime -> Connection -> IO (Doc AnsiStyle )
1576
1594
overdueTasks conf now connection = do
Original file line number Diff line number Diff line change 1
1
cabal-version : 2.2
2
2
3
- -- This file has been generated from package.yaml by hpack version 0.31 .2.
3
+ -- This file has been generated from package.yaml by hpack version 0.34 .2.
4
4
--
5
5
-- see: https://github.com/sol/hpack
6
6
--
You can’t perform that action at this time.
0 commit comments