Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configurable granularity units, change ETA to estimate using this configuration #98

Closed

Conversation

myndzi
Copy link

@myndzi myndzi commented May 18, 2015

Add option 'units', it is a map of unit labels to values (in seconds), e.g. { 's': 1, 'm': 60, 'h': 3600 }
Modify ETA estimation to return the least granular unit for which the eta is >= 1, based on supplied values
Add replacement token ':unit', returns the label associated with the unit value
ProgressBar.defaultUnits holds the h/m/s arrangement; it is not actually used by default to preserve compatibility

Example usage: new ProgressBar(':eta:unit', { units: ProgressBar.defaultUnits });
Example output: '12.3m' -> '38.5s' (changes from minutes to seconds over time)

Addresses #63

I see there is already a pull request for this functionality; I implemented this before seeing that one, but this seems potentially more useful. Just go ahead and reject if this isn't what you want.

…, e.g. { 's': 1, 'm': 60, 'h': 3600 }

Modify ETA estimation to return the least granular unit for which the eta is >= 1, based on supplied values
Add replacement token ':unit', returns the label associated with the unit value
ProgressBar.defaultUnits holds the h/m/s arrangement; it is not actually used by default to preserve compatibility

Example usage: new ProgressBar(':eta:unit', { units: ProgressBar.defaultUnits });
Example output: '12.3m' -> '38.5s' (changes from minutes to seconds over time)

Addresses visionmedia#63
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants