You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
611 B
EmacsLisp

(load-file "~/Documents/drive/admin/emacs/daysoff.el")
(defcustom workday nil
"Returns true on working days"
:type 'boolean)
(if (equal (format-time-string "%a") "Sat")
(setq workday nil)
(if (equal (format-time-string "%a") "Sun")
(setq workday nil)
(if (member (format-time-string "%Y-%m-%d") daysoff)
(setq workday nil)
(setq workday t))))
(defcustom workhours nil
"Returns true during working hours"
:type 'boolean)
(if workday
(if (< (string-to-number (format-time-string "%H")) 19)
(if (> (string-to-number (format-time-string "%H")) 7)
(setq workhours t))))