Re: [calsify] JSCalendar duration vs. end time

"Neil Jenkins" <neilj@fastmailteam.com> Thu, 14 February 2019 23:20 UTC

Return-Path: <neilj@fastmailteam.com>
X-Original-To: calsify@ietfa.amsl.com
Delivered-To: calsify@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1912C13126A for <calsify@ietfa.amsl.com>; Thu, 14 Feb 2019 15:20:29 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.983
X-Spam-Level:
X-Spam-Status: No, score=-1.983 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, MIME_HEADER_CTYPE_ONLY=0.717, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=fastmailteam.com header.b=zEzK0aQg; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=jo6v8hUU
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xKzB_mUxZUDS for <calsify@ietfa.amsl.com>; Thu, 14 Feb 2019 15:20:27 -0800 (PST)
Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 0A3AE13123A for <calsify@ietf.org>; Thu, 14 Feb 2019 15:20:26 -0800 (PST)
Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 3B3C822326 for <calsify@ietf.org>; Thu, 14 Feb 2019 18:20:26 -0500 (EST)
Received: from imap7 ([10.202.2.57]) by compute6.internal (MEProxy); Thu, 14 Feb 2019 18:20:26 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= fastmailteam.com; h=message-id:in-reply-to:references:date:from :to:subject:content-type; s=fm1; bh=WaRuCqm4oY5TbXm6saVv19b5vQGX JMUQMOiTjaKw/XQ=; b=zEzK0aQgd8X6XsCS+bZiJqMLDd9wXeBul0t0f2FIRqif GAbGEQnpudyZ8sYPuCuiRpshnO2bRbNMz4RCtow9OqkqbSZd6qE52FhFxOZUk6KF HkaNxeNQyKUceU4haSI0AVzNgKGqpTyiFqzSRx4TmfTLT3GhzO+yXyHl8nUJ/TQA B/drcAD3eqxabQDLYL20lPlMSnYZju0F2x6ZyWYzIvbNEGd7Devuww3T0Wgi/eaY lf5Cl47TeOut8THqk+WLOcRMucJ4luUpjxLfLe0oubOsQAT4vH+qKp0lOhVBPFr+ QgDAQwx1emXlDvNEGZ6SqmN3pgg97/RzPwa93fjr3w==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:references:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=WaRuCqm4oY5TbXm6s aVv19b5vQGXJMUQMOiTjaKw/XQ=; b=jo6v8hUUN0RJ7b1tmZkOvBdVDHIcpvboV 6t5Byt0OxzoVATeZmwIbsXnezvIX9ZdiHZ73heEVs5YcmDnb8lKP4M1ZpzLXHM8y 8gfdAYAMDdH2JX4b7O2oFHD5AzRfnKp+3kJpKmjRNg4qixeimABKpposOJsip5qM klfCFurUEUmnuy6zMsRBlmsoAVrw+tg9HQ1PAnAKkRX0UoXSoA/Hv4eFv01G0409 BbOgJGtl9VTornfUhWfMVmEYmwYAufKiIgW0lBXyjNcY76GBU0+ckOag4KG+oJrf 5SzFeyPZh+3ctuVRzWQF6ag5WDiSBYTDjOBDlsV60FOU9gfpLY5oQ==
X-ME-Sender: <xms:ufdlXPdy9RbQyJehaNSvPdppTkCI2I9DgqgVc9Ss7W9zp3jCgTUiig>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgtdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhepofgfkfgjfhffhffvufgtsegrtderreerredtnecuhfhrohhmpe dfpfgvihhlucflvghnkhhinhhsfdcuoehnvghilhhjsehfrghsthhmrghilhhtvggrmhdr tghomheqnecurfgrrhgrmhepmhgrihhlfhhrohhmpehnvghilhhjsehfrghsthhmrghilh htvggrmhdrtghomhenucevlhhushhtvghrufhiiigvpedt
X-ME-Proxy: <xmx:ufdlXKNDAy9Puja_g88-tyi0ATKFAmcbxiSISycQ1EF2TASZ48k8mA> <xmx:ufdlXN42M2a-kqUvu6kJk4jyglRTOLtSy0wdjg0wJkrjv2hla-FKxA> <xmx:ufdlXOGEOhkWi6jsIO9Nc4FlCrgGWptVudBGAsW6yDtqi_6YBRPwZQ> <xmx:uvdlXEwLbj0WBF9DpZiCNFgmAz8A_HLDBWomPuIL4BEzx2rfkOa-aA>
Received: by mailuser.nyi.internal (Postfix, from userid 501) id 5567420250; Thu, 14 Feb 2019 18:20:25 -0500 (EST)
X-Mailer: MessagingEngine.com Webmail Interface
User-Agent: Cyrus-JMAP/3.1.5-832-gba113d7-fmstable-20190201v1
X-Me-Personality: 64588216
Message-Id: <aec2692f-a2dc-4004-b1e4-4e3d3680aa9b@beta.fastmail.com>
In-Reply-To: <1550160126.3602072.1658018976.28709BD3@webmail.messagingengine.com>
References: <1550160126.3602072.1658018976.28709BD3@webmail.messagingengine.com>
Date: Thu, 14 Feb 2019 18:20:24 -0500
From: Neil Jenkins <neilj@fastmailteam.com>
To: calsify@ietf.org
Content-Type: multipart/alternative; boundary="53036da0c1064414bf534248f6411811"
Archived-At: <https://mailarchive.ietf.org/arch/msg/calsify/VcEocOGxQilPr6RYGFq40WYdHlg>
Subject: Re: [calsify] JSCalendar duration vs. end time
X-BeenThere: calsify@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: <calsify.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/calsify>, <mailto:calsify-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/calsify/>
List-Post: <mailto:calsify@ietf.org>
List-Help: <mailto:calsify-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/calsify>, <mailto:calsify-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 14 Feb 2019 23:20:35 -0000

On Fri, 15 Feb 2019, at 03:03, Robert Stepanek wrote:
> Two arguments were raised in favor of adding an end time
>  * It simplifies translation of VEVENTs with DTSTART/DTEND from iCalendar.

Every client/server will need to be able to translate between duration and end already, so this is unlikely to be a significant hurdle to anyone.

>  * It allows to specify recurring events with a fixed end time even in case of time gaps (e.g. a recurring night club that has to close at a fixed time for legal reasons).

You kind-of mention this below, but I think it's important to note that *this argument is false*. You cannot do this with recurrences as they exist right now in iCalendar. 

On Fri, 15 Feb 2019, at 05:25, Alexander Nimmervoll wrote:
> But looking into it also from client UI perspective almost every client allows you to choose start and end time and not start time and duration for an event.

The UI is independent of the underlying data format; as mentioned above you need to be able to translate between the two anyway.

> Is there a reason you choose start time and duration vs start time and end time?

Yes. There are many reasons why I strongly believe duration is preferable to end:
 1. Having two representations for the same thing requires more code complexity, as there are two code paths to deal with.
 2. Recurrences always operate with duration regardless of whether it's actually specified as "end time", which is very confusing. With duration, it's very clean: you expand the start time according to the recurrence rule and then just inherit every other property (duration is just another property you inherit).
 3. There is no extra expressivity adding "end time". You can always convert from end time to duration. The *one* exception is if the time zone data changed so that an offset transition now happened in the middle of the event AND in such a case you wanted the event to maintain its original end time rather than its original duration. I contend that:
   1. This case is exceedingly rare, and not important enough to make the common case more complex.
   2. No UI will ever be built to offer the user a choice for how to handle this situation, so it's even less important to handle.
   3. A better way to handle it would be to add an extra property that could be used to indicate the duration should be done in "wall clock" time; this would then also work for recurrences, which there is no solution for in iCalendar.
 4. Duration is guaranteed to be zero or positive, making it harder to create an invalid event and easier to check that an event object is valid. If you move the start of a series of events you don't need to make sure to keep the end in sync.
 5. Should time zone definitions change, it is more likely the duration should remain fixed and the end should shift (e.g. for flights).

> Using start and end time allows also an easier specification of different start and end timezones

This is modelled differently in JSCalendar: there is a single time zone for the event, which is what it is scheduled in, but you can associate time zones with locations and mark that a location is where the event finishes, which is equivalent to the end time zone in iCalendar. This again is clearer, as it more closely matches the semantics of iCalendar (the "end" time zone is not used for scheduling/recurrences, it is only used for displaying in the UI after the necessary date arithmetic). And if time zone definitions change, again it's more likely the duration should stay constant rather than the end time (the example everyone uses for a different end time zone is flights: flying from Melbourne to LA is not going to get an hour shorter if California suddenly changes its daylight saving rules).

Neil.