Function: icalendar-date-time-locally-earlier

icalendar-date-time-locally-earlier is a byte-compiled function defined in icalendar-utils.el.gz.

Signature

(icalendar-date-time-locally-earlier DT1 DT2 &optional OR-EQUAL)

Documentation

Return non-nil if date-time DT1 is locally earlier than DT2.

Unlike icalendar-date-time<, this function assumes both times are local to some time zone and does not consider their zone information.

If OR-EQUAL is non-nil, this function acts like <= rather than <: it will return non-nil if DT1 and DT2 are locally the same time.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/icalendar-utils.el.gz
(defun ical:date-time-locally-earlier (dt1 dt2 &optional or-equal)
  "Return non-nil if date-time DT1 is locally earlier than DT2.

Unlike `icalendar-date-time<', this function assumes both times are
local to some time zone and does not consider their zone information.

If OR-EQUAL is non-nil, this function acts like `<=' rather than `<':
it will return non-nil if DT1 and DT2 are locally the same time."
  (let ((year1 (decoded-time-year dt1))
        (year2 (decoded-time-year dt2))
        (month1 (decoded-time-month dt1))
        (month2 (decoded-time-month dt2))
        (day1 (decoded-time-day dt1))
        (day2 (decoded-time-day dt2))
        (hour1 (decoded-time-hour dt1))
        (hour2 (decoded-time-hour dt2))
        (minute1 (decoded-time-minute dt1))
        (minute2 (decoded-time-minute dt2))
        (second1 (decoded-time-second dt1))
        (second2 (decoded-time-second dt2)))
    (or (< year1 year2)
        (and (= year1 year2)
             (or (< month1 month2)
                 (and (= month1 month2)
                      (or (< day1 day2)
                          (and (= day1 day2)
                               (or (< hour1 hour2)
                                   (and (= hour1 hour2)
                                        (or (< minute1 minute2)
                                            (and (= minute1 minute2)
                                                 (if or-equal
                                                     (<= second1 second2)
                                                   (< second1 second2))))))))))))))