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

Feature Request: duration pipes #73

Open
antidote2 opened this issue Sep 29, 2018 · 4 comments
Open

Feature Request: duration pipes #73

antidote2 opened this issue Sep 29, 2018 · 4 comments
Labels

Comments

@antidote2
Copy link

Thank you! I like this library! Did I miss something or why duration pipes are not included.
I would like to be able to convert for example milliseconds to minutes.
value_in_ms = 60000;
{{value_in_ms | duration: ms: min}} would print "1 min"

@fknop
Copy link
Owner

fknop commented Sep 29, 2018

Hello, you can check out https://github.com/urish/ngx-moment for all pipes related to time and durations.

@antidote2
Copy link
Author

I already checked and it actually fits special cases. Don't like their humanize method. I want to be able to cast exactly the output that I need. Simple configurable pipes would do that. No need for humanize magic. https://github.com/urish/ngx-moment/blob/master/src/duration.pipe.ts

@fknop fknop added the wontfix label Oct 24, 2018
@thelebdev
Copy link
Contributor

What exactly is your request? (e.g. use case, since milliseconds is not something most people would use)

@antidote2
Copy link
Author

I want to provide a duration value together with units: like 60000 + ms or 15.43 + min.
As output I would expect a similar simple conversion like is done for bytes/KB/MB/GB...
As human you don't want to see 60000 ms - you want to see 1 min. moment.js produces for 1-2 seconds "a few seconds". You cannot use this for a datatable.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants