Skip to content

[Bug]: calendar suggest-time fails with a RangeError for an --hours range with impossible minutes #51189

Done

Description

@Pr1p

Where were you using Orca?

Desktop only

Operating system

Windows

Remote host operating system

Not sure

Orca version

current main (6bf4294)

Details

orca calendar suggest-time --with [email protected] --duration 30m --hours 09:75-17:00 fails with RangeError: Invalid time value after the free/busy request, instead of the usage text.

parseHours (src/main/google/google-calendar-free-time.ts) accepts minutes 00 to 99 ((\d{2})) and then only compares the padded strings, so 09:75 and 17:60 pass. The bound is handed to zonedInstant, where Intl.DateTimeFormat.formatToParts(new Date(NaN)) throws.

Hours above 24 are already refused (to > '24:00', from >= to), so only the minutes get through.

Expected: --hours takes a range like 09:00-17:00., the message an unparseable range already gets.

Not platform-specific; checked on Windows 10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions