Skip to content

Support duration/interval type in the system package #1907

Open
@wonderyl

Description

@wonderyl

Feature Request

Is your feature request related to a problem? Please describe:
It's pretty common to have durations/intervals in configuration. e.g. time out. Currently KCL doesn't have duration/interval natively. We can either express it as an int or str or a custom defined schema. This is not as convenient. On the other hand, KCL supports datetime in the system package, it's pretty natural to support duration/interval as well.

Describe the feature you'd like:
Here's an imaginary usage of duration in KCL.

import datetime
import duration

start = datetime.today()
length = duration.minute(10) + duration.minute(30)
end = start + length

Describe alternatives you've considered:
Currently we define custom schema to represent a duration and define lambda functions to operate it.

Teachability, Documentation, Adoption, Migration Strategy:
See the second section

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions