Skip to content

Commit

Permalink
Fixes for date-fns@2
Browse files Browse the repository at this point in the history
  • Loading branch information
feross committed Aug 21, 2019
1 parent 8e132ea commit f2ddb77
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var createTorrent = require('create-torrent')
var debug = require('debug')('instant.io')
var dragDrop = require('drag-drop')
var get = require('simple-get')
var distanceInWords = require('date-fns/distance_in_words')
var formatDistance = require('date-fns/formatDistance')
var path = require('path')
var prettierBytes = require('prettier-bytes')
var throttle = require('throttleit')
Expand Down Expand Up @@ -194,7 +194,7 @@ function onTorrent (torrent) {
remaining = 'Done.'
} else {
remaining = torrent.timeRemaining !== Infinity
? distanceInWords(0, torrent.timeRemaining, { includeSeconds: true })
? formatDistance(torrent.timeRemaining, 0, { includeSeconds: true })
: 'Infinity years'
remaining = remaining[0].toUpperCase() + remaining.substring(1) + ' remaining.'
}
Expand Down

0 comments on commit f2ddb77

Please sign in to comment.