diff options
-rw-r--r-- | awk/filter_due.awk | 2 | ||||
-rw-r--r-- | awk/stats_positions.awk | 2 | ||||
-rw-r--r-- | awk/utils.awk | 2 | ||||
-rw-r--r-- | org-fc-awk.el | 17 | ||||
-rw-r--r-- | org-fc.el | 6 |
5 files changed, 21 insertions, 8 deletions
diff --git a/awk/filter_due.awk b/awk/filter_due.awk index b85fdfe..0406847 100644 --- a/awk/filter_due.awk +++ b/awk/filter_due.awk @@ -1,6 +1,6 @@ BEGIN { FS="\t"; - now = strftime("%FT%T", systime(), 1); + now = strftime("%FT%TZ", systime(), 1); } $4 == "0" && $9 < now { diff --git a/awk/stats_positions.awk b/awk/stats_positions.awk index 740ac52..464cf5b 100644 --- a/awk/stats_positions.awk +++ b/awk/stats_positions.awk @@ -6,7 +6,7 @@ BEGIN { interval = 0; box = 0; due = 0; - now = strftime("%FT%T", systime(), 1); + now = strftime("%FT%TZ", systime(), 1); n_stats = 0; } diff --git a/awk/utils.awk b/awk/utils.awk index 00045de..159f9b7 100644 --- a/awk/utils.awk +++ b/awk/utils.awk @@ -15,7 +15,7 @@ function trim_surrounding(str) { # Time n days before the current time function time_days_ago(n) { - return strftime("%FT%T", systime() - 24 * 60 * 60 * n, 1); + return strftime("%FT%TZ", systime() - 24 * 60 * 60 * n, 1); } function or_default(var, def) { diff --git a/org-fc-awk.el b/org-fc-awk.el index f19bf0f..e095625 100644 --- a/org-fc-awk.el +++ b/org-fc-awk.el @@ -139,7 +139,7 @@ parsing each element with its header specification." (shell-command-to-string (org-fc-awk--pipe (org-fc-awk--find paths) - (org-fl-awk--xargs + (org-fc-awk--xargs (org-fc-awk--command "awk/index_cards.awk" :utils t @@ -160,7 +160,7 @@ parsing each element with its header specification." ;; TODO: Optimize card order for review (defun org-fc-awk-due-positions-for-paths (paths) - "Generate a list of due positions cards in randomized order." + "Generate a list of due positions." (org-fc-tsv-parse org-fc-awk-position-headers (shell-command-to-string @@ -173,6 +173,19 @@ parsing each element with its header specification." :variables (org-fc-awk--indexer-variables))) (org-fc-awk--command "awk/filter_due.awk"))))) +(defun org-fc-awk-positions-for-paths (paths) + "Generate a list of all positions." + (org-fc-tsv-parse + org-fc-awk-position-headers + (shell-command-to-string + (org-fc-awk--pipe + (org-fc-awk--find paths) + (org-fc-awk--xargs + (org-fc-awk--command + "awk/index_positions.awk" + :utils t + :variables (org-fc-awk--indexer-variables))))))) + (cl-defun org-fc-awk-stats-positions (&optional (paths org-fc-directories)) "Statistics for all positions in PATHS." (org-fc-awk--key-value-parse @@ -89,7 +89,7 @@ ;; TODO: Allow customizing this, currently that's not possible because ;; the indexers / filters expect a ISO8601 format. -(defvar org-fc-timestamp-format "%FT%H:%M:%S" +(defvar org-fc-timestamp-format "%FT%TZ" "Format to use for storing timestamps. Defaults to ISO8601") @@ -107,8 +107,8 @@ Only 'awk is supported at the moment.") ;;; Helper Functions (defun org-fc-timestamp-now () - "ISO8601 timestamp of the current time in the UTC0 timezone" - (format-time-string org-fc-timestamp-format nil "UTC0")) + "ISO8601 timestamp of the current time in the UTC timezone" + (format-time-string org-fc-timestamp-format nil "UTC")) (defun org-fc-days-overdue (ts) "Number of days between now and the ISO8601 timestamp TS." |