Skip to content

Support Temporal.Duration as input for Effect.duration #6102

@RobinVdBroeck

Description

@RobinVdBroeck

What is the problem this feature would solve?

Currently, the syntax for passing a duration somewhere is non standard. Either you do something like '{n} {unit}' or pass the milliseconds (see DurationInput). This is not ideal, since the syntax differs alot from what's built into modern browsers, making onboarding and code reuse more difficult.

It also makes it hard to describe something spanning multiple units, like 1 hours 10 minutes for example. This introduces possible buggy conversion while converting this duration to minutes before passing it to effect.

What is the feature you are proposing to solve the problem?

Make Temporal.Duration an input for Effect.Duration. This would than allow the following code:
```Schedule.fixed(Temporal.Duration.from({hours: 1, minutes: 10 })`

What alternatives have you considered?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions