Function: timeclock-status-string

timeclock-status-string is an autoloaded, interactive and byte-compiled function defined in timeclock.el.gz.

Signature

(timeclock-status-string &optional SHOW-SECONDS TODAY-ONLY)

Documentation

Report the overall timeclock status at the present moment.

If SHOW-SECONDS is non-nil, display second resolution. If TODAY-ONLY is non-nil, the display will be relative only to time worked today, ignoring the time worked on previous days.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/timeclock.el.gz
;;;###autoload
(defun timeclock-status-string (&optional show-seconds today-only)
  "Report the overall timeclock status at the present moment.
If SHOW-SECONDS is non-nil, display second resolution.
If TODAY-ONLY is non-nil, the display will be relative only to time
worked today, ignoring the time worked on previous days."
  (interactive "P")
  (let* ((remainder (timeclock-workday-remaining
		     (or today-only
			 (not timeclock-relative))))
         (last-in (equal (car timeclock-last-event) "i"))
         (status
	  (format "Currently %s since %s (%s), %s %s, leave at %s"
		  (if last-in "IN" "OUT")
		  (if show-seconds
		      (format-time-string "%-I:%M:%S %p"
					  (nth 1 timeclock-last-event))
		    (format-time-string "%-I:%M %p"
					(nth 1 timeclock-last-event)))
		  (or (nth 2 timeclock-last-event)
		      (if last-in "**UNKNOWN**" "workday over"))
		  (timeclock-seconds-to-string remainder show-seconds t)
		  (if (> remainder 0)
		      "remaining" "over")
		  (timeclock-when-to-leave-string show-seconds today-only))))
    (if (called-interactively-p 'interactive)
	(message "%s" status)
      status)))