Skip to content

Use native Temporal.ZonedDateTime for time zone comparison #37

Description

@fabon-f

context: tc39/proposal-temporal#3301

It is still early to implement it for several reasons.

There is no runtime or browser which will benefit from the change for now. Current implementation (based on Intl.DateTimeFormat.prototype.resolvedOptions) still works in V8 and SpiderMonkey. It doesn't work in latest JavaScriptCore, but JSC haven't implemented Temporal yet.

Also Node.js v26 doesn't properly compare time zone IDs (cf. nodejs/node#63145), so the change will introduce a regression until Node.js is fixed.

new Temporal.ZonedDateTime(0n, 'Europe/Bratislava').equals(
    new Temporal.ZonedDateTime(0n, 'Europe/Prague')
);
// `true` in Node.js v26, but `false` is expected

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions