Skip to content

Temporal API - Temporal.ZonedDateTime.with results in Invalid argument for Temporal #1106

@ryc76

Description

@ryc76

The following results in error

error: Uncaught TypeError: Invalid argument for Temporal ........\v8\src\objects\js-temporal-objects.cc:2047
let zoned2 = zoned.with({hour: 10});

PlainDateTime.with works fine but ZonedDateTime does not

let plain = Temporal.PlainDateTime.from('2022-01-28T19:53+01:00[Europe/Berlin]');

let plain2 = plain.with({hour: 11});

let zoned = Temporal.ZonedDateTime.from('2022-01-28T19:53+01:00[Europe/Berlin]');

let zoned2 = zoned.with({hour: 10});

I'm guessing it just hasn't been implemented yet. If so then I will work around it for now.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions