Skip to content

Commit

Permalink
Merge pull request #53 from gobwas/patch-1
Browse files Browse the repository at this point in the history
Rename `long` and `short`
  • Loading branch information
leo authored Sep 3, 2016
2 parents 368c464 + 004d137 commit 899d463
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ var y = d * 365.25;
module.exports = function(val, options){
options = options || {};
if ('string' == typeof val) return parse(val);
return options.long
? long(val)
: short(val);
return options['long']
? fmtLong(val)
: fmtShort(val);
};

/**
Expand Down Expand Up @@ -90,7 +90,7 @@ function parse(str) {
* @api private
*/

function short(ms) {
function fmtShort(ms) {
if (ms >= d) return Math.round(ms / d) + 'd';
if (ms >= h) return Math.round(ms / h) + 'h';
if (ms >= m) return Math.round(ms / m) + 'm';
Expand All @@ -106,7 +106,7 @@ function short(ms) {
* @api private
*/

function long(ms) {
function fmtLong(ms) {
return plural(ms, d, 'day')
|| plural(ms, h, 'hour')
|| plural(ms, m, 'minute')
Expand Down

0 comments on commit 899d463

Please sign in to comment.