mirror of
https://github.com/SqrtMinusOne/pomm.el.git
synced 2025-12-10 14:43:03 +03:00
feat: add custom date format for the csv history
This commit is contained in:
parent
a2cf50dfc4
commit
47432a11f9
1 changed files with 10 additions and 2 deletions
12
pomm.el
12
pomm.el
|
|
@ -123,6 +123,14 @@ of period. The format is as follows:
|
||||||
:group 'pomm
|
:group 'pomm
|
||||||
:type 'string)
|
:type 'string)
|
||||||
|
|
||||||
|
(defcustom pomm-csv-history-file-timestamp-format "%s"
|
||||||
|
"Timestamp format in the csv file.
|
||||||
|
|
||||||
|
The format is the same as in `format-time-string'. The default
|
||||||
|
one is the UNIX timestamp."
|
||||||
|
:group 'pomm
|
||||||
|
:type 'string)
|
||||||
|
|
||||||
(defcustom pomm-on-tick-hook nil
|
(defcustom pomm-on-tick-hook nil
|
||||||
"A hook to run on every tick when the timer is running."
|
"A hook to run on every tick when the timer is running."
|
||||||
:group 'pomm
|
:group 'pomm
|
||||||
|
|
@ -231,8 +239,8 @@ variable doesn't exist, function does nothing."
|
||||||
(with-temp-file pomm-csv-history-file
|
(with-temp-file pomm-csv-history-file
|
||||||
(insert "timestamp,status,period,iteration\n")))
|
(insert "timestamp,status,period,iteration\n")))
|
||||||
(write-region
|
(write-region
|
||||||
(format "%d,%s,%s,%d\n"
|
(format "%s,%s,%s,%d\n"
|
||||||
(time-convert nil 'integer)
|
(format-time-string pomm-csv-history-file-timestamp-format)
|
||||||
(symbol-name (alist-get 'status pomm--state))
|
(symbol-name (alist-get 'status pomm--state))
|
||||||
(symbol-name (alist-get 'kind (alist-get 'current pomm--state)))
|
(symbol-name (alist-get 'kind (alist-get 'current pomm--state)))
|
||||||
(or (alist-get 'iteration (alist-get 'current pomm--state)) 0))
|
(or (alist-get 'iteration (alist-get 'current pomm--state)) 0))
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue