• danA
    link
    fedilink
    arrow-up
    6
    ·
    2 months ago

    It’s a pretty good API. I recently built an appointment booking form and used Temporal for it. Thankfully, all the date logic is server-side (in server-side actions on an Astro site) so I didn’t have to worry about browser compatibility.

    I just have a few small nitpicks, but they’re pretty easily fixable by using my own classes that extend the standard Temporal ones, or just standalone functions. Some examples:

    • I wish the classes like Date, DateTime, ZonedDateTime, etc had methods like isBefore and isAfter to compare to another instance. For some reason, I can never remember whether compare returning a negative number means the first argument is less than or greater than the second one. Maybe one day we’ll get operator overloading.
    • I wish there was a way to set the default calendar. I had to manually pass calendar: 'gregory' in a bunch of places because I ended up hitting issues without it (one example). My code isn’t running outside of areas that use the Gregorian calendar, so setting it as a default in my code would be ideal.

    Node support was a bit rough in June/July so I ended up using the polyfill, but I think they’ve fixed all the major issues now.