Subject: 30.0.50; icalendar-import-file generates a wrong diary-block end date with both weekly and byday.

From: TAKAHASHI Yoshio <[email-masked]>
Date: Sun, 24 Dec 2023 10:54:44 +0900

Hi,

icalendar-import-file generates a wrong diary-block end date when an
input ics has both WEEKLY and BYDAY.  It counts 7 days per COUNT even if
BYDAY is specified.

Please see included "in.ics" and "out.diary" that I use to check:
  (icalendar-import-file "in.ics" "out.diary")

diary-block with COUNT=2 starts from 2023-09-28 Thursday should be
  (diary-block 9 28 2023 9 29 2023)
insetad of
  (diary-block 9 28 2023 10 12 2023)
.

in.ics
--8<---------------cut here---------------start------------->8---
BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook 16.0 MIMEDIR//EN
VERSION:2.0
METHOD:PUBLISH
BEGIN:VTIMEZONE
TZID:Tokyo Standard Time
BEGIN:STANDARD
DTSTART:16010101T000000
TZOFFSETFROM:+0900
TZOFFSETTO:+0900
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
CLASS:PUBLIC
DTEND;TZID="Tokyo Standard Time":20230928T080000
DTSTAMP:20230927T223304Z
DTSTART;TZID="Tokyo Standard Time":20230928T073000
RRULE:FREQ=WEEKLY;COUNT=2;BYDAY=MO,TU,WE,TH,FR
SEQUENCE:0
SUMMARY;LANGUAGE=ja:あいうえお
TRANSP:OPAQUE
UID:040000008200E00074C5B7101A82E00800000000A0B94EC51984D901000000000000000
	0100000007D56C1DF9E90BA42AE840AB94F4F4D64
END:VEVENT
END:VCALENDAR
--8<---------------cut here---------------end--------------->8---

out.diary
--8<---------------cut here---------------start------------->8---
%%(and (memq (calendar-day-of-week date) '(1 2 3 4 5)) (diary-block 9 28 2023 10 12 2023)) 07:30-08:00 あいうえお
--8<---------------cut here---------------end--------------->8---

In GNU Emacs 30.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version
 3.24.33, cairo version 1.16.0) of 2023-12-23 built on LAPTOP-89LTAUNV
Repository revision: 1be62044732df0c4f1be9679a4ada09850a9e2ab
Repository branch: HEAD
Windowing system distributor 'Microsoft Corporation', version 11.0.12010000
System Description: Ubuntu 22.04.3 LTS

-- 
TAKAHASHI Yoshio <[email-masked]>