https://github.com/jefreesujit/time-formatter
https://github.com/jefreesujit/time-formatter
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/jefreesujit/time-formatter
- Owner: Jefreesujit
- License: bsd-2-clause
- Created: 2016-04-20T06:56:02.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2018-07-19T18:18:39.000Z (almost 8 years ago)
- Last Synced: 2025-03-11T02:38:57.229Z (over 1 year ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# time-formatter
A simple code to format decimal numbers with time extensions.
## Installation
`npm install time-formatter`
## Usage
var timeFormatter = require('time-formatter');
var formattedMin = timeFormatter.minutes(3566, false);
// Output should be `3566 min`
var formattedMin = timeFormatter.minutes(3566, true);
// Output should be `2 d 11 hr 26 min`
Parameters :
timeFormatter.function(val1, val2);
val1 : Integer | required
val2 : Boolean | optional
Output Format : String
available Functions :
1) timeFormatter.minutes(val1, val2);
2) timeFormatter.seconds(val1, val2);
3) timeFormatter.hours(val1, val2);
## Contributing
In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.