Skip to content

Commit

Permalink
Use .slice() in favor of soon to be deprecated .substr()
Browse files Browse the repository at this point in the history
  • Loading branch information
mhxbe committed Sep 22, 2019
1 parent 0ea734d commit 27b2de0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils.js
Expand Up @@ -44,7 +44,7 @@ exports.getCurrentTime = function () {
const year = time.getFullYear();
const month = MONTHS[time.getMonth()];
const day = time.getDate();
const hour = `0${time.getHours()}`.substr(-2);
const minute = `0${time.getMinutes()}`.substr(-2);
const hour = `0${time.getHours()}`.slice(-2);
const minute = `0${time.getMinutes()}`.slice(-2);
return `${day} ${month} ${year} at ${hour}:${minute}`;
};

0 comments on commit 27b2de0

Please sign in to comment.