Skip to content

Commit

Permalink
Fixed bug with the display style of comment time
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethanm committed Jun 1, 2018
1 parent bac3b49 commit ecb11f2
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions libs/scripts/common.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
function convertDateFromString(dateString) {
if (dateString) {
var arr1 = dateString.split(" ");
var sdate = arr1[0].split('-');
var date = new Date(sdate[0], sdate[1] - 1, sdate[2]);
return date;
}
}

const padWithZeros = (vNumber, width) => {
var numAsString = vNumber.toString();
while (numAsString.length < width) {
Expand All @@ -26,7 +17,7 @@ const dateFormat = (date) => {
}

const timeAgoWithTimeStr = (dateString) => {
var date = convertDateFromString(dateString)
var date = new Date(dateString)

try {
var oldTime = date.getTime();
Expand Down Expand Up @@ -61,7 +52,7 @@ const timeAgoWithTimeStr = (dateString) => {
}
} catch (error) {
console.log(error)
}
}
}

const timeAgo = (date) => {
Expand Down

0 comments on commit ecb11f2

Please sign in to comment.