From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#34315: [PATCH] icalendar.el: DURATION fix + more robust timezone handling Date: Thu, 01 Oct 2020 03:45:59 +0200 Message-ID: <874knewwfc.fsf@gnus.org> References: <23640.9851.562972.730234@AGAME7.local> <875ztog7hx.fsf@panama> <87wom1otsw.fsf@panama> <87zh7267sy.fsf@gnus.org> <87pn7yo54t.fsf@panama> <83o8ni4fhu.fsf@gnu.org> <24369.32256.954408.774614@AGAME7.local> <87y2mlxx8r.fsf@gnus.org> <87d03x43kz.fsf@panama> <24371.59842.984273.402129@AGAME7.local> <87y2mkknyc.fsf@gnus.org> <24371.61149.995030.284670@AGAME7.local> <87364rq4yl.fsf@panama> <87imcwf404.fsf@panama> <24400.43911.666145.400179@AGAME7.local> <874kof2aui.fsf@panama> <24435.1743.473339.944597@AGAME7.local> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14200"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 34315@debbugs.gnu.org, Jan Tatarik To: thunk2@arcor.de (Thomas Plass) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 01 03:47:17 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kNngi-0003XX-Cy for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 01 Oct 2020 03:47:16 +0200 Original-Received: from localhost ([::1]:46306 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kNngh-0000P2-0m for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 30 Sep 2020 21:47:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kNngU-0000Ov-EO for bug-gnu-emacs@gnu.org; Wed, 30 Sep 2020 21:47:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50153) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kNngU-00020g-3l for bug-gnu-emacs@gnu.org; Wed, 30 Sep 2020 21:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kNngU-000635-1m for bug-gnu-emacs@gnu.org; Wed, 30 Sep 2020 21:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Oct 2020 01:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34315 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 34315-submit@debbugs.gnu.org id=B34315.160151677723199 (code B ref 34315); Thu, 01 Oct 2020 01:47:01 +0000 Original-Received: (at 34315) by debbugs.gnu.org; 1 Oct 2020 01:46:17 +0000 Original-Received: from localhost ([127.0.0.1]:33466 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNnfh-000623-Ef for submit@debbugs.gnu.org; Wed, 30 Sep 2020 21:46:17 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:52730) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNnff-00061q-LQ for 34315@debbugs.gnu.org; Wed, 30 Sep 2020 21:46:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=BmeWzZEfLLT4cx+DbfSstVi/qkXC2LuTQxGeLfy79ZQ=; b=JyDjVS1410t2ZwKiVjZGjeG3aA SO3/EIoxGUsib498FJWew6hsoBqq1L9PQTfiyFdZFA8xOv7OSOMAOX3YQxJNr0j6s0XD42NmnxkVq XzoJjyYxmf1b7thkAXhlxgCjtSIWs00mB1cS2TNJ4so/86z5qroo5GRLf3amARVr4QU8=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kNnfU-0000Q7-SG; Thu, 01 Oct 2020 03:46:04 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAGFBMVEWcMhiqUBnRaR/m mDZaKBL83mL+9IL////OESbrAAAAAWJLR0QHFmGI6wAAAAd0SU1FB+QKAQEpMNBQSYAAAAG0SURB VDjLlZPBkcMgDEXFhgKATAoAJgUExneS0MCOx+lg038Jq4/Adja57D94bD2QZPQhGrLKWhe6bJAg x+wunAEKFkO8zCuOxszyiYESsG1JMYdMxfSglWiUHRvwurJCFgH0RBy91oI0DYQOHKpnH6V0bjVG ad+LN5AykSGJYO20iBqg4xYYmhs4L29qwJym/4JdqmlJ0yeQXPRZQOSjXUHy3MrXumMDF8PATG9g Nm2Qh55KdcAHx6ASRXwEgDi1eLJtyprXXe4BxR0OLgWMv5Cuh1lXAZqni7PF8lIrXWq98TyIR8QB cUuporuPVBgUXZtbqMd5h6Xi+8cuzsDQNeCt1BfdvGPQC2jUZqvQAF4XJUa0rbN1h9V1s7O1Zg9q AfHYYnqNI6kAC6ruod4Zdggo1Jw6Gr4ilWvtajRmtN4B2z5I8aEruVdcEKm8GDSsYkumBtzukg0B vNy+fgVXgFQvsP3HuJDQ6kRH9GLQx/P58wPC4DzPbM0Fj2k5Px7f8ykDFAbnOMDyfEougOWTHNVj 7reu94p3tFvG3fz7g2wCZeSEDAYmU7kGEn8ojhmi3Rn8AnCwxQRK+Y+kAAAAJXRFWHRkYXRlOmNy ZWF0ZQAyMDIwLTEwLTAxVDAxOjQxOjQ4KzAwOjAw8rtNgQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAy MC0xMC0wMVQwMTo0MTo0OCswMDowMIPm9T0AAAAASUVORK5CYII= X-Now-Playing: Hood's _The Lost You_: "You Can't Breathe Memories" In-Reply-To: <24435.1743.473339.944597@AGAME7.local> (Thomas Plass's message of "Tue, 29 Sep 2020 12:05:03 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:189449 Archived-At: --=-=-= Content-Type: text/plain thunk2@arcor.de (Thomas Plass) writes: > - in celebration, I'd like to submit yet another patch that extends > icalendar.el's timezone handling, this one intended to support > regions that at some point in the past made a permanent switch from > a DST/STD scheme to STD-only/DST-only. Cases in point are China > and Turkey, > cf. https://en.wikipedia.org/wiki/Daylight_saving_time_in_Asia. > > Ulf, would you care to review the code and the included test cases? Thanks for the code. It was in slightly inconvenient format -- we prefer just simple patches, so I've reformatted it as such below. However, the code makes two tests fail: 2 unexpected results: FAILED icalendar--convert-tz-offset FAILED icalendar--parse-vtimezone I haven't actually looked at the failing cases, though. In addition, the test cases included aren't actually used? Could you propose some code to use them? (It should go in test/lisp/calendar/icalendar-tests.el.) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=icalendar.patch Content-Transfer-Encoding: 8bit diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el index dab277487e..e4760db3e4 100644 --- a/lisp/calendar/icalendar.el +++ b/lisp/calendar/icalendar.el @@ -519,46 +519,56 @@ icalendar--convert-tz-offset (dtstart (car (cddr (assq 'DTSTART alist)))) (no-dst (or rdate-p (equal offsetto offsetfrom)))) ;; FIXME: the presence of an RDATE is assumed to denote the first day of the year - (when (and offsetto dtstart (or rrule-value no-dst)) - (let* ((rrule (icalendar--split-value rrule-value)) - (freq (cadr (assq 'FREQ rrule))) - (bymonth (cadr (assq 'BYMONTH rrule))) - (byday (cadr (assq 'BYDAY rrule)))) - ;; FIXME: we don't correctly handle WKST here. - (if (or no-dst (and (string= freq "YEARLY") bymonth)) - (cons - (concat - ;; Fake a name. - (if dst-p "DST" "STD") - ;; For TZ, OFFSET is added to the local time. So, - ;; invert the values. - (if (eq (aref offsetto 0) ?-) "+" "-") - (substring offsetto 1 3) - ":" - (substring offsetto 3 5)) - ;; The start time. - (let* ((day (if no-dst - 1 - (icalendar--get-weekday-number (substring byday -2)))) - (week (if no-dst - "1" - (if (eq day -1) - byday - (substring byday 0 -2))))) - ;; "Translate" the iCalendar way to specify the last - ;; (sun|mon|...)day in month to the tzset way. - (if (string= week "-1") ; last day as iCalendar calls it + (if (and offsetto dtstart (or rrule-value no-dst)) + (let* ((rrule (icalendar--split-value rrule-value)) + (freq (cadr (assq 'FREQ rrule))) + (bymonth (cadr (assq 'BYMONTH rrule))) + (byday (cadr (assq 'BYDAY rrule)))) + ;; FIXME: we don't correctly handle WKST here. + (if (or no-dst (and (string= freq "YEARLY") bymonth)) + (cons + (concat + ;; Fake a name. + (if dst-p "DST" "STD") + ;; For TZ, OFFSET is added to the local time. So, + ;; invert the values. + (if (eq (aref offsetto 0) ?-) "+" "-") + (substring offsetto 1 3) + ":" + (substring offsetto 3 5)) + ;; The start time. + (let* ((day (if no-dst + 1 + (icalendar--get-weekday-number (substring byday -2)))) + (week (if no-dst + "1" + (if (eq day -1) + byday + (substring byday 0 -2))))) + ;; "Translate" the iCalendar way to specify the last + ;; (sun|mon|...)day in month to the tzset way. + (if (string= week "-1") ; last day as iCalendar calls it (setq week "5")) ; last day as tzset calls it (when no-dst (setq bymonth "1")) (concat "M" bymonth "." week "." (if (eq day -1) "0" (int-to-string day)) - ;; Start time. - "/" - (substring dtstart -6 -4) - ":" - (substring dtstart -4 -2) - ":" - (substring dtstart -2))))))))) + ;; Start time. + "/" + (substring dtstart -6 -4) + ":" + (substring dtstart -4 -2) + ":" + (substring dtstart -2)))))) + ;; neither RRULE nor RDATE present: return the offset and a placeholder + (cons + (concat + ;; Fake a name. + (if dst-p "DST" "STD") + (if (eq (aref offsetto 0) ?-) "+" "-") + (substring offsetto 1 3) + ":" + (substring offsetto 3 5)) + dtstart)))) (defun icalendar--parse-vtimezone (alist) "Turn a VTIMEZONE ALIST into a cons (ID . TZ-STRING). @@ -571,34 +581,59 @@ icalendar--parse-vtimezone (standard (cadr (cdar (icalendar--get-most-recent-observance alist 'STANDARD)))) (std (and standard (icalendar--convert-tz-offset standard nil)))) (if (and tz-id std) - (cons tz-id - (if day - (concat (car std) (car day) - "," (cdr day) "," (cdr std)) - (car std)))))) + (cons tz-id + (if (and (not (assq 'RRULE daylight)) + (not (assq 'RRULE standard))) + (let ((daylight-rdate (and (assq 'RDATE daylight) + (icalendar--get-most-recent-observance-from-sub-comp + daylight + '(RDATE)))) + (standard-rdate (and (assq 'RDATE standard) + (icalendar--get-most-recent-observance-from-sub-comp + standard + '(RDATE))))) + (if (and daylight-rdate + standard-rdate + (string-greaterp daylight-rdate standard-rdate)) + (car day) + (car std))) + (if day + (concat (car std) (car day) + "," (cdr day) "," (cdr std)) + (car std))))))) (defun icalendar--get-most-recent-observance (alist sub-comp) - "Return the latest observance for SUB-COMP DAYLIGHT or STANDARD. + "Return the latest observance of all SUB-COMPs DAYLIGHT or STANDARD. ALIST is a VTIMEZONE potentially containing historical records." -;FIXME?: "most recent" should be relative to a given date +;FIXME: "most recent" should be relative to a given date and +; avoid selecting a SUB-COMP valid for dates in the future. (let ((components (icalendar--get-children alist sub-comp))) (list (car (sort components #'(lambda (a b) - (let* ((get-recent (lambda (n) - (car - (sort - (delq nil - (mapcar (lambda (p) - (and (memq (car p) '(DTSTART RDATE)) - (car (cddr p)))) - n)) - 'string-greaterp)))) - (a-recent (funcall get-recent (car (cddr a)))) - (b-recent (funcall get-recent (car (cddr b))))) + (let* ((a-recent (icalendar--get-most-recent-observance-from-sub-comp + (car (cddr a)) + '(DTSTART RDATE))) + (b-recent (icalendar--get-most-recent-observance-from-sub-comp + (car (cddr b)) + '(DTSTART RDATE)))) (string-greaterp a-recent b-recent)))))))) +(defun icalendar--get-most-recent-observance-from-sub-comp (alist sym-list) + "Return the latest observance for ALIST DAYLIGHT or STANDARD. +ALIST is an individual DAYLIGHT or STANDARD. +SYM-LIST is a list of property names DTSTART and/or RDATE +for filtering ALIST." + (car + (sort + (delq nil + (mapcar (lambda (p) + (when (memq (car p) sym-list) + (car (cddr p)))) + alist)) + 'string-greaterp))) + (defun icalendar--convert-all-timezones (icalendar) "Convert all timezones in the ICALENDAR into an alist. Each element of the alist is a cons (ID . TZ-STRING), diff --git a/test/lisp/calendar/icalendar-resources/Asia_Istanbul_20200924T120000_in-calendar_VTIMEZONE_tzurl_org.ics b/test/lisp/calendar/icalendar-resources/Asia_Istanbul_20200924T120000_in-calendar_VTIMEZONE_tzurl_org.ics new file mode 100644 index 0000000000..6425909be6 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/Asia_Istanbul_20200924T120000_in-calendar_VTIMEZONE_tzurl_org.ics @@ -0,0 +1,219 @@ +BEGIN:VCALENDAR +PRODID:manual +VERSION:2.0 +BEGIN:VTIMEZONE +TZID:Asia/Istanbul +TZURL:http://tzurl.org/zoneinfo/Asia/Istanbul +X-LIC-LOCATION:Asia/Istanbul +BEGIN:STANDARD +TZOFFSETFROM:+015552 +TZOFFSETTO:+015656 +TZNAME:IMT +DTSTART:18800101T000000 +RDATE:18800101T000000 +END:STANDARD +BEGIN:STANDARD +TZOFFSETFROM:+015656 +TZOFFSETTO:+0200 +TZNAME:EET +DTSTART:19101001T000000 +RDATE:19101001T000000 +END:STANDARD +BEGIN:DAYLIGHT +TZOFFSETFROM:+0200 +TZOFFSETTO:+0300 +TZNAME:EEST +DTSTART:19160501T000000 +RDATE:19160501T000000 +RDATE:19200328T000000 +RDATE:19210403T000000 +RDATE:19220326T000000 +RDATE:19240513T000000 +RDATE:19250501T000000 +RDATE:19400630T000000 +RDATE:19401201T000000 +RDATE:19420401T000000 +RDATE:19450402T000000 +RDATE:19460601T000000 +RDATE:19470420T000000 +RDATE:19480418T000000 +RDATE:19490410T000000 +RDATE:19500419T000000 +RDATE:19510422T000000 +RDATE:19620715T000000 +RDATE:19640515T000000 +RDATE:19700503T000000 +RDATE:19710502T000000 +RDATE:19720507T000000 +RDATE:19730603T010000 +RDATE:19740331T020000 +RDATE:19750330T000000 +RDATE:19760601T000000 +RDATE:19770403T000000 +RDATE:19780402T000000 +RDATE:19860330T010000 +RDATE:19870329T010000 +RDATE:19880327T010000 +RDATE:19890326T010000 +RDATE:19900325T010000 +RDATE:19910331T010000 +RDATE:19920329T010000 +RDATE:19930328T010000 +RDATE:19940320T010000 +RDATE:19950326T010000 +RDATE:19960331T010000 +RDATE:19970330T010000 +RDATE:19980329T010000 +RDATE:19990328T010000 +RDATE:20000326T010000 +RDATE:20010325T010000 +RDATE:20020331T010000 +RDATE:20030330T010000 +RDATE:20040328T010000 +RDATE:20050327T010000 +RDATE:20060326T010000 +RDATE:20070325T030000 +RDATE:20080330T030000 +RDATE:20090329T030000 +RDATE:20100328T030000 +RDATE:20110328T030000 +RDATE:20120325T030000 +RDATE:20130331T030000 +RDATE:20140331T030000 +RDATE:20150329T030000 +RDATE:20160327T030000 +END:DAYLIGHT +BEGIN:STANDARD +TZOFFSETFROM:+0300 +TZOFFSETTO:+0200 +TZNAME:EET +DTSTART:19161001T000000 +RDATE:19161001T000000 +RDATE:19201025T000000 +RDATE:19211003T000000 +RDATE:19221008T000000 +RDATE:19241001T000000 +RDATE:19251001T000000 +RDATE:19401005T000000 +RDATE:19410921T000000 +RDATE:19421101T000000 +RDATE:19451008T000000 +RDATE:19461001T000000 +RDATE:19471005T000000 +RDATE:19481003T000000 +RDATE:19491002T000000 +RDATE:19501008T000000 +RDATE:19511008T000000 +RDATE:19621008T000000 +RDATE:19641001T000000 +RDATE:19701004T000000 +RDATE:19711003T000000 +RDATE:19721008T000000 +RDATE:19731104T030000 +RDATE:19741103T050000 +RDATE:19751026T000000 +RDATE:19761031T000000 +RDATE:19771016T000000 +RDATE:19850928T000000 +RDATE:19860928T020000 +RDATE:19870927T020000 +RDATE:19880925T020000 +RDATE:19890924T020000 +RDATE:19900930T020000 +RDATE:19910929T020000 +RDATE:19920927T020000 +RDATE:19930926T020000 +RDATE:19940925T020000 +RDATE:19950924T020000 +RDATE:19961027T020000 +RDATE:19971026T020000 +RDATE:19981025T020000 +RDATE:19991031T020000 +RDATE:20001029T020000 +RDATE:20011028T020000 +RDATE:20021027T020000 +RDATE:20031026T020000 +RDATE:20041031T020000 +RDATE:20051030T020000 +RDATE:20061029T020000 +RDATE:20071028T040000 +RDATE:20081026T040000 +RDATE:20091025T040000 +RDATE:20101031T040000 +RDATE:20111030T040000 +RDATE:20121028T040000 +RDATE:20131027T040000 +RDATE:20141026T040000 +END:STANDARD +BEGIN:DAYLIGHT +TZOFFSETFROM:+0300 +TZOFFSETTO:+0400 +TZNAME:+04 +DTSTART:19781015T000000 +RDATE:19781015T000000 +RDATE:19800406T030000 +RDATE:19810329T030000 +RDATE:19820328T030000 +RDATE:19830731T000000 +END:DAYLIGHT +BEGIN:DAYLIGHT +TZOFFSETFROM:+0400 +TZOFFSETTO:+0400 +TZNAME:+04 +DTSTART:19790401T030000 +RDATE:19790401T030000 +END:DAYLIGHT +BEGIN:STANDARD +TZOFFSETFROM:+0400 +TZOFFSETTO:+0300 +TZNAME:+03 +DTSTART:19791015T000000 +RDATE:19791015T000000 +RDATE:19801013T000000 +RDATE:19811012T000000 +RDATE:19821011T000000 +RDATE:19831002T000000 +END:STANDARD +BEGIN:DAYLIGHT +TZOFFSETFROM:+0300 +TZOFFSETTO:+0300 +TZNAME:EEST +DTSTART:19850420T000000 +RDATE:19850420T000000 +RDATE:20151025T040000 +END:DAYLIGHT +BEGIN:STANDARD +TZOFFSETFROM:+0200 +TZOFFSETTO:+0200 +TZNAME:EET +DTSTART:20070101T000000 +RDATE:20070101T000000 +RDATE:20110327T030000 +RDATE:20140330T030000 +END:STANDARD +BEGIN:STANDARD +TZOFFSETFROM:+0300 +TZOFFSETTO:+0200 +DTSTART:20151108T040000 +RDATE:20151108T040000 +END:STANDARD +BEGIN:STANDARD +TZOFFSETFROM:+0300 +TZOFFSETTO:+0300 +TZNAME:+03 +DTSTART:20160907T000000 +RDATE:20160907T000000 +END:STANDARD +END:VTIMEZONE +BEGIN:VEVENT +CLASS:PUBLIC +DTSTART;TZID=Asia/Istanbul:20200924T120000 +DTEND;TZID=Asia/Istanbul:20200924T130000 +UID:Asia_Istanbul_20200924T120000_in-calendar_VTIMEZONE_tzurl_org.ics +DTSTAMP:20190127T140400 +DESCRIPTION:date 2020-09-24, Istanbul local time 12:00 UTC+3, in-calendar + VTIMEZONE as returned by http://tzurl.org/zoneinfo/Asia/Istanbul +SUMMARY:date 2020-09-24, Istanbul local time 12:00 UTC+3, in-calendar + VTIMEZONE as returned by http://tzurl.org/zoneinfo/Asia/Istanbul +END:VEVENT +END:VCALENDAR diff --git a/test/lisp/calendar/icalendar-resources/Asia_Shanghai_20200916T070000_in-calendar_VTIMEZONE_multi_DAYLIGHT_STANDARD.ics b/test/lisp/calendar/icalendar-resources/Asia_Shanghai_20200916T070000_in-calendar_VTIMEZONE_multi_DAYLIGHT_STANDARD.ics new file mode 100644 index 0000000000..26dd3cbfb8 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/Asia_Shanghai_20200916T070000_in-calendar_VTIMEZONE_multi_DAYLIGHT_STANDARD.ics @@ -0,0 +1,116 @@ +BEGIN:VCALENDAR +PRODID:manual +VERSION:2.0 +CALSCALE:GREGORIAN +METHOD:PUBLISH +BEGIN:VTIMEZONE +TZID:Asia/Shanghai +X-LIC-LOCATION:Asia/Shanghai +BEGIN:STANDARD +TZNAME:CST +DTSTART:19411001T000000 +TZOFFSETFROM:+0900 +TZOFFSETTO:+0800 +END:STANDARD +BEGIN:DAYLIGHT +TZNAME:CDT +DTSTART:19860504T000000 +TZOFFSETFROM:+0800 +TZOFFSETTO:+0900 +END:DAYLIGHT +BEGIN:STANDARD +TZNAME:CST +DTSTART:19860914T000000 +TZOFFSETFROM:+0900 +TZOFFSETTO:+0800 +END:STANDARD +BEGIN:DAYLIGHT +TZNAME:CDT +DTSTART:19870412T000000 +TZOFFSETFROM:+0800 +TZOFFSETTO:+0900 +END:DAYLIGHT +BEGIN:STANDARD +TZNAME:CST +DTSTART:19870913T000000 +TZOFFSETFROM:+0900 +TZOFFSETTO:+0800 +END:STANDARD +BEGIN:DAYLIGHT +TZNAME:CDT +DTSTART:19880410T000000 +TZOFFSETFROM:+0800 +TZOFFSETFROM:+0800 +TZOFFSETTO:+0900 +END:DAYLIGHT +BEGIN:STANDARD +TZNAME:CST +DTSTART:19880911T000000 +TZOFFSETFROM:+0900 +TZOFFSETTO:+0800 +END:STANDARD +BEGIN:DAYLIGHT +TZNAME:CDT +DTSTART:19890416T000000 +TZOFFSETFROM:+0800 +TZOFFSETTO:+0900 +END:DAYLIGHT +BEGIN:STANDARD +TZNAME:CST +DTSTART:19890917T000000 +TZOFFSETFROM:+0900 +TZOFFSETTO:+0800 +END:STANDARD +BEGIN:DAYLIGHT +TZNAME:CDT +DTSTART:19900415T000000 +TZOFFSETFROM:+0800 +TZOFFSETTO:+0900 +END:DAYLIGHT +BEGIN:STANDARD +TZNAME:CST +DTSTART:19900916T000000 +TZOFFSETFROM:+0900 +TZOFFSETTO:+0800 +END:STANDARD +BEGIN:DAYLIGHT +TZNAME:CDT +DTSTART:19910414T000000 +TZOFFSETFROM:+0800 +TZOFFSETTO:+0900 +END:DAYLIGHT +BEGIN:STANDARD +TZNAME:CST +DTSTART:19910915T000000 +TZOFFSETFROM:+0900 +TZOFFSETTO:+0800 +END:STANDARD +END:VTIMEZONE +BEGIN:VTIMEZONE +TZID:Etc/UTC +X-LIC-LOCATION:Etc/UTC +BEGIN:STANDARD +TZNAME:UTC +DTSTART:19700101T000000 +TZOFFSETFROM:+0000 +TZOFFSETTO:+0000 +END:STANDARD +END:VTIMEZONE +BEGIN:VEVENT +CLASS:PUBLIC +DTSTART;TZID=Asia/Shanghai:20200916T070000 +DTEND;TZID=Asia/Shanghai:20200916T080000 +UID:Asia_Shanghai_20200916T070000_in-calendar_VTIMEZONE_multi_DAYLIGHT_STANDARD.ics +DTSTAMP:20190127T140400 +DESCRIPTION:date 2020-09-16, Shanghai local time 07:00 UTC+8, in-calendar + VTIMEZONE with multiple DAYLIGHT and STANDARD sub-components, cf. + https://techcommunity.microsoft.com/t5/office-365/import-ics-to-office-365 + -calendar-but-the-event-time-is-wrong/td-p/215332 +SUMMARY:date 2020-09-16, Shanghai local time 07:00 UTC+8, in-calendar + VTIMEZONE with multiple DAYLIGHT and STANDARD sub-components, cf. + https://techcommunity.microsoft.com/t5/office-365/import-ics-to-office-365 + -calendar-but-the-event-time-is-wrong/td-p/215332 +END:VEVENT +END:VCALENDAR + + diff --git a/test/lisp/calendar/icalendar-resources/Asia_Shanghai_20200916T070000_in-calendar_VTIMEZONE_tzurl_org.ics b/test/lisp/calendar/icalendar-resources/Asia_Shanghai_20200916T070000_in-calendar_VTIMEZONE_tzurl_org.ics new file mode 100644 index 0000000000..ccd39bd114 --- /dev/null +++ b/test/lisp/calendar/icalendar-resources/Asia_Shanghai_20200916T070000_in-calendar_VTIMEZONE_tzurl_org.ics @@ -0,0 +1,65 @@ +BEGIN:VCALENDAR +PRODID:manual +VERSION:2.0 +BEGIN:VTIMEZONE +TZID:Asia/Shanghai +TZURL:http://tzurl.org/zoneinfo/Asia/Shanghai +X-LIC-LOCATION:Asia/Shanghai +BEGIN:STANDARD +TZOFFSETFROM:+080543 +TZOFFSETTO:+0800 +TZNAME:CST +DTSTART:19010101T000000 +RDATE:19010101T000000 +END:STANDARD +BEGIN:DAYLIGHT +TZOFFSETFROM:+0800 +TZOFFSETTO:+0900 +TZNAME:CDT +DTSTART:19400601T000000 +RDATE:19400601T000000 +RDATE:19410315T000000 +RDATE:19420131T000000 +RDATE:19460515T000000 +RDATE:19470415T000000 +RDATE:19480501T000000 +RDATE:19490501T000000 +RDATE:19860504T020000 +RDATE:19870412T020000 +RDATE:19880417T020000 +RDATE:19890416T020000 +RDATE:19900415T020000 +RDATE:19910414T020000 +END:DAYLIGHT +BEGIN:STANDARD +TZOFFSETFROM:+0900 +TZOFFSETTO:+0800 +TZNAME:CST +DTSTART:19401012T235959 +RDATE:19401012T235959 +RDATE:19411101T235959 +RDATE:19450901T235959 +RDATE:19460930T235959 +RDATE:19471031T235959 +RDATE:19480930T235959 +RDATE:19490528T000000 +RDATE:19860914T020000 +RDATE:19870913T020000 +RDATE:19880911T020000 +RDATE:19890917T020000 +RDATE:19900916T020000 +RDATE:19910915T020000 +END:STANDARD +END:VTIMEZONE +BEGIN:VEVENT +CLASS:PUBLIC +DTSTART;TZID=Asia/Shanghai:20200916T070000 +DTEND;TZID=Asia/Shanghai:20200916T080000 +UID:Asia_Shanghai_20200916T070000_in-calendar_VTIMEZONE_tzurl_org.ics +DTSTAMP:20190127T140400 +DESCRIPTION:date 2020-09-16, Shanghai local time 07:00 UTC+8, in-calendar + VTIMEZONE as returned by http://tzurl.org/zoneinfo/Asia/Shanghai +SUMMARY:date 2020-09-16, Shanghai local time 07:00 UTC+8, in-calendar + VTIMEZONE as returned by http://tzurl.org/zoneinfo/Asia/Shanghai +END:VEVENT +END:VCALENDAR --=-=-=--