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

Add TimeParameter & RelativeTimeParameter #92

Open
NanoSector opened this issue Jan 1, 2018 · 0 comments
Open

Add TimeParameter & RelativeTimeParameter #92

NanoSector opened this issue Jan 1, 2018 · 0 comments

Comments

@NanoSector
Copy link
Member

NanoSector commented Jan 1, 2018

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'.

@NanoSector NanoSector self-assigned this Jan 1, 2018
@NanoSector NanoSector changed the title Add TimeParameter Add TimeParameter & RelativeTimeParameter May 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant