Skip to content
This repository was archived by the owner on Aug 13, 2023. It is now read-only.
This repository was archived by the owner on Aug 13, 2023. It is now read-only.

Add TimeParameter & RelativeTimeParameter #92

@NanoSector

Description

@NanoSector

Add a type of parameter which parses the given relative time (e.g. 1s, 4h, 5m, 6d, 7w...) or absolute time (18:05, etc.) and converts it to a set unit.

Syntax would be 'new RelativeTimeParameter('default time format (s/m/h/d/w/y)')' where the default time format is also the one to which the integer will be converted.

RelativeTimeParameter('m') with argument '1h' would return 60 (minutes) for example while TimeParameter('s') with 1h would be 3600 (seconds).

TimeParameter is different in that it can take a time format to convert to. E.g. TimeParameter('d-m-Y H:i') with 18:00 passed would assume 18:00 this day and thus return '22-05-2018 18:00'.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions