We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dcdb521 commit 1470eebCopy full SHA for 1470eeb
1 file changed
src/commands/schedule_tasks.janet
@@ -17,6 +17,10 @@
17
(defn- remove-year [formatted-date]
18
(string/join (drop 1 (string/split "-" formatted-date)) "-"))
19
20
+(defn- last-day-of-month? [date]
21
+ (def tomorrow (date/+days date 1))
22
+ (not= (date :month) (tomorrow :month)))
23
+
24
# Public
25
(defn scheduled-for? [task date]
26
(def formatted-date (date/format date true))
@@ -27,7 +31,8 @@
27
31
"every 3 months" (and (= (date :day) 1)
28
32
(index-of (date :month) [1 4 7 10]))
29
33
(string "every year on " (remove-year formatted-date)) true
30
- (string "on " formatted-date) true))
34
+ (string "on " formatted-date) true
35
+ "every last day" (last-day-of-month? date)))
36
37
(defn- missed-on-day [plan task date]
38
(find (fn [day] (and (scheduled-for? task (day :date))
0 commit comments