Format
This commit is contained in:
parent
fd793b791d
commit
a7f927516e
1 changed files with 14 additions and 14 deletions
|
@ -970,23 +970,23 @@ This is meant to be an helper to be called from the window manager."
|
||||||
"Check if node was created in given time range"
|
"Check if node was created in given time range"
|
||||||
#'org-roam-node-date
|
#'org-roam-node-date
|
||||||
#'(lambda (node-date start-date end-date)
|
#'(lambda (node-date start-date end-date)
|
||||||
(let ((node-date (condition-case nil
|
(let ((node-date (condition-case nil
|
||||||
;; if the entry is not from the journal (i.e. the filename is not something like "2024-10-10.org")
|
;; if the entry is not from the journal (i.e. the filename is not something like "2024-10-10.org")
|
||||||
;; then it's always discarded (the epoch time is given to it)
|
;; then it's always discarded (the epoch time is given to it)
|
||||||
(encode-time (org-parse-time-string node-date))
|
(encode-time (org-parse-time-string node-date))
|
||||||
(error (encode-time (org-parse-time-string "<1970-01-01>")))))
|
(error (encode-time (org-parse-time-string "<1970-01-01>")))))
|
||||||
(start-date (encode-time (org-parse-time-string start-date)))
|
(start-date (encode-time (org-parse-time-string start-date)))
|
||||||
(end-date (encode-time (org-parse-time-string end-date))))
|
(end-date (encode-time (org-parse-time-string end-date))))
|
||||||
(and (time-less-p start-date node-date)
|
(and (time-less-p start-date node-date)
|
||||||
(time-less-p node-date end-date)))
|
(time-less-p node-date end-date)))
|
||||||
))
|
))
|
||||||
|
|
||||||
(defun ccr/org-roam-spent-hours (client &optional date-start date-end)
|
(defun ccr/org-roam-spent-hours (client &optional date-start date-end)
|
||||||
"Return the total spent hours on something (usually a client)"
|
"Return the total spent hours on something (usually a client)"
|
||||||
(let* ((query-tags `(tags ,client "billable"))
|
(let* ((query-tags `(tags ,client "billable"))
|
||||||
(query (if (and date-start date-end)
|
(query (if (and date-start date-end)
|
||||||
`(and ,query-tags (date-range ,date-start ,date-end))
|
`(and ,query-tags (date-range ,date-start ,date-end))
|
||||||
query-tags)))
|
query-tags)))
|
||||||
(apply #'+(mapcar #'org-roam-node-spent (org-roam-ql-nodes query))))))
|
(apply #'+(mapcar #'org-roam-node-spent (org-roam-ql-nodes query))))))
|
||||||
|
|
||||||
(use-package org-roam-ql
|
(use-package org-roam-ql
|
||||||
|
@ -1064,7 +1064,7 @@ This is meant to be an helper to be called from the window manager."
|
||||||
(defun ccr/edit-buffer (buffer-name old-string new-string)
|
(defun ccr/edit-buffer (buffer-name old-string new-string)
|
||||||
"In BUFFER-NAME, replace OLD-STRING with NEW-STRING."
|
"In BUFFER-NAME, replace OLD-STRING with NEW-STRING."
|
||||||
(with-current-buffer buffer-name
|
(with-current-buffer buffer-name
|
||||||
(let ((case-fold-search nil)) ;; Case-sensitive search
|
(let ((case-fold-search nil)) ;; Case-sensitive search
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(let ((count 0))
|
(let ((count 0))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue