X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/021edd45dcde128c94e068df8e24935c21458437..12154b449fc01a19f9d3310ca68a09e4ea2b963a:/lisp/calendar/cal-dst.el diff --git a/lisp/calendar/cal-dst.el b/lisp/calendar/cal-dst.el index 78bb3c1272..3e33f6cb9f 100644 --- a/lisp/calendar/cal-dst.el +++ b/lisp/calendar/cal-dst.el @@ -1,6 +1,6 @@ ;;; cal-dst.el --- calendar functions for daylight savings rules. -;; Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. +;; Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc. ;; Author: Paul Eggert ;; Edward M. Reingold @@ -20,8 +20,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to -;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. ;;; Commentary: @@ -37,6 +38,7 @@ ;;; Code: (require 'calendar) +(require 'cal-persia) (defvar calendar-current-time-zone-cache nil "Cache for result of calendar-current-time-zone.") @@ -127,7 +129,7 @@ Return nil if no such transition can be found." (defun calendar-time-zone-daylight-rules (abs-date utc-diff) "Return daylight transition rule for ABS-DATE, UTC-DIFF sec offset from UTC. -ABS-DIFF must specify a day that contains a daylight savings transition. +ABS-DATE must specify a day that contains a daylight savings transition. The result has the proper form for calendar-daylight-savings-starts'." (let* ((date (calendar-gregorian-from-absolute abs-date)) (weekday (% abs-date 7)) @@ -152,7 +154,16 @@ The result has the proper form for calendar-daylight-savings-starts'." (cons (list 'calendar-nth-named-day 1 weekday m 'year j) l))) - l))) + l) + ;; 01-01 and 07-01 for this year's Persian calendar. + (if (and (= m 3) (<= 20 d) (<= d 21)) + '((calendar-gregorian-from-absolute + (calendar-absolute-from-persian + (list 1 1 (- year 621)))))) + (if (and (= m 9) (<= 22 d) (<= d 23)) + '((calendar-gregorian-from-absolute + (calendar-absolute-from-persian + (list 7 1 (- year 621)))))))) (prevday-sec (- -1 utc-diff)) ;; last sec of previous local day (year (1+ y))) ;; Scan through the next few years until only one rule remains.