Re: [calsify] RFC 5545/JSCalendar questions from ECMAScript TC39 "Temporal" working group

Justin Grant <justingrant.ietf.public@gmail.com> Tue, 29 September 2020 23:44 UTC

Return-Path: <justingrant.ietf.public@gmail.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 190B63A13E1 for <calsify@ietfa.amsl.com>; Tue, 29 Sep 2020 16:44:41 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.097
X-Spam-Level:
X-Spam-Status: No, score=-2.097 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
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 fBr2hUO54fgm for <calsify@ietfa.amsl.com>; Tue, 29 Sep 2020 16:44:39 -0700 (PDT)
Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E950D3A13CE for <calsify@ietf.org>; Tue, 29 Sep 2020 16:44:38 -0700 (PDT)
Received: by mail-ej1-x62d.google.com with SMTP id q13so49662ejo.9 for <calsify@ietf.org>; Tue, 29 Sep 2020 16:44:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1i/7liMyb49G/iIr+ywQP33mqNvGXVRCct1xYBGLQB0=; b=ATjZ5+yRb/cDow/GZGcEIsa8v+po+fDVQAsbPlS9pyrc7xViYbGlSMGNWALdE1rRO+ KWIyIWL7T4kyeuJeMMf1QXwPaA8gZFxsppl9OVKJpGtqIvh/zsXeENVe2/i/SFQRsa0X igfRM6cY0aBi0sDm5T7tjJhpO4rB7ngoci0zc+3yr/2EZfxroLsdE5Gb9DEHp/2Lv7Up gvoHU193DcveNDKoNchue97dLI4LjOfe7kn94uK0jWZMFXlxXXcGFpddxVr423wNHlrZ wvXMA0yZqCfOTyEKVZ+0dbXXpsBsXyRAUAQ/RCCMc6wBPmEB0d7Wukk9u3kiRgb769Sc 4C8w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1i/7liMyb49G/iIr+ywQP33mqNvGXVRCct1xYBGLQB0=; b=e8ZuIm556rn6HdGEkL/juI5R6oM4Qmrl5rA+80PMUpap4vQKZHnK1rk9lsiSI7DhHh Ky9C2DvV/83e73X00soNOLGbVvCi+Y9b4IDsdu7S8S/OkN5mzOJnjz+zpJf2A//4GUMu GjvHqbeKdco8hXKe5TNvV3g77exPFZHpB2tOb/6mct4uyjbwTxHtkNoSDiyEFXxAPPJr UvD7clWMqVOTYVddBmO02wHeKBIUeu1O5C0DqKu7XHgk3GpH8NZDtwvRIRtDzIsaXBxA xORokOxAyMrkP50WG284hB4DMjKGWkO+fgxvDrDpM79eE1T40myJvQIDSaDC0RH9vY2o NfOA==
X-Gm-Message-State: AOAM533rlSE5oWxaE/HjXe2xdxZ8Bf7kRaNbMQ/xQaJsnKssxtxcKHlt 8VEvYjWVQ9QO572kYtSbPq9ctzauvJ7ZJiIGWAS6CDMJSXw=
X-Google-Smtp-Source: ABdhPJzsHwimlGGQg4krUQUIICRk7YoNTFPM77I3E4SY/3WGD+PmlJXXHMBnPWa5GJyV+3Pjr7h/vdtLsXUSdm4ldXw=
X-Received: by 2002:a17:906:9416:: with SMTP id q22mr103430ejx.82.1601423077534; Tue, 29 Sep 2020 16:44:37 -0700 (PDT)
MIME-Version: 1.0
References: <CACy7CficiNXA_tb01c0=PWQTnXPVu_e7TgWAKUVPY-ow9C=3SQ@mail.gmail.com> <5bfd4453-e9a9-4bf4-b403-1b2f19cc790a@dogfood.fastmail.com> <CACy7CfgbPG_ugC59CZWtMwA7w4UOJR=zUkovKzvHUdeoFxnpjg@mail.gmail.com> <6d357b96-9899-4bd3-93e0-97e147a86a4d@dogfood.fastmail.com> <CACy7Cfjfdu7yyjvVCcvYag7AVMrekqiSCfm6pQZ8PiQLFiJ7Aw@mail.gmail.com> <CACy7CfgBBHxu=gHirXs3xVc30psU0+F-E0ttiUiJ4KvSCR9Qew@mail.gmail.com> <e0656c88-6a1b-49b0-9fa4-14a794e9fb82@dogfood.fastmail.com> <CACy7CfhKg2rZsdPy0ELVrGwGdDvg+ELQWYN+YMrsYEyc6_8BJQ@mail.gmail.com>
In-Reply-To: <CACy7CfhKg2rZsdPy0ELVrGwGdDvg+ELQWYN+YMrsYEyc6_8BJQ@mail.gmail.com>
From: Justin Grant <justingrant.ietf.public@gmail.com>
Date: Tue, 29 Sep 2020 16:44:26 -0700
Message-ID: <CACy7CfjdvXsWTYZ7qO3-BN3VJV0bdFUtZQgtxRLiF1qVJMFM1w@mail.gmail.com>
To: Neil Jenkins <neilj@fastmailteam.com>
Cc: calsify@ietf.org
Content-Type: multipart/alternative; boundary="000000000000abef7505b07c5dac"
Archived-At: <https://mailarchive.ietf.org/arch/msg/calsify/9rPGjL2YRM6SUmW1uDY_wmZ4kPk>
Subject: Re: [calsify] RFC 5545/JSCalendar questions from ECMAScript TC39 "Temporal" working group
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: Tue, 29 Sep 2020 23:44:41 -0000

BTW, "But if E falls inside a DST skipped hour" should have read "But if
END falls inside a DST skipped hour"

On Tue, Sep 29, 2020 at 4:43 PM Justin Grant <
justingrant.ietf.public@gmail.com> wrote:

> Hi Neil - I'm working on a sample implementation of the algorithms we've
> been discussing for addition, subtraction, and calculating the difference
> between date/time values.
>
> I'm trying to figure out if there's an algorithm that can make all
> operations reversible, meaning that the last two comparisons below should
> be true:
> * let START = some date/time value with a time zone
> * let D = some duration
> * let END = START + D
> * let DIFF = END - START
> * let UNDO = END - DIFF
> * assert DIFF == D
> * assert UNDO == START
>
> But if E falls inside a DST skipped hour, then I'm not sure that both the
> comparisons can be true. Example:
>
> * START = 2020-03-07T02:30-08:00[America/Los_Angeles]
> * D = P1D
> * END = START + D == 2020-03-07T03:30-07:00[America/Los_Angeles]
> * DIFF = END - START == P1D (OK)
> * UNDO = END - DIFF == 2020-03-07T03:30-08:00[America/Los_Angeles]
> * UNDO != START (3:30 vs. 2:30)
>
> I think this result is probably OK (because DST is weird) but I'm
> wondering if the difference calculation in this case should return P1D
> (which makes `end - start == P1D`) or P1DT1H (which would make `undo ==
> start`). Or is there some possible algorithm which could make both
> comparisons true?  If not, then would it be better for the first comparison
> to work and the second to fail, or is it better for the second to work and
> the first to fail?
>
> Cheers,
> Justin
>
>
> On Sun, Aug 16, 2020 at 4:39 PM Neil Jenkins <neilj@fastmailteam.com>
> wrote:
>
>> On Sun, 16 Aug 2020, at 05:16, Justin Grant wrote:
>>
>> Hi Neil - reviewing this now. Had a quick question:
>>
>> > Let T = Y - X in absolute time => PT23H45M
>>
>> Why is X used here instead of I?  Here's what I would have expected:
>>
>> Let T = Y - *I* in absolute time  => PT23H45M
>>
>>
>> Correct. This was an error, it should be *I* as you say.
>>
>> Neil.
>>
>