-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added time to comments, fixed a bunch of redux stuff
- Loading branch information
Showing
10 changed files
with
71 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
node_modules | ||
dev.js | ||
.vscode | ||
.vscode |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const generateDaysAgoText = timeInMilliseconds => { | ||
const timeInSeconds = Math.floor(timeInMilliseconds / 1000) | ||
if (timeInSeconds < 30) return "Just now" | ||
else if (timeInSeconds < 60) return "<1 minute ago" | ||
else if (timeInSeconds < 3599) return `${Math.floor(timeInSeconds / 60)} minute${timeInSeconds > 120 ? "s" : ""} ago` | ||
else if (timeInSeconds < 86399) return `${Math.floor(timeInSeconds / 3600)} hour${timeInSeconds > 7200 ? "s" : ""} ago` | ||
else if (timeInSeconds < 604799) return `${Math.floor(timeInSeconds / 86400)} day${timeInSeconds > 172800 ? "s" : ""} ago` | ||
else return "A long time ago" | ||
} | ||
|
||
export default generateDaysAgoText |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import shortenText from "./shortenText" | ||
import generateDaysAgoText from "./generateDaysAgoText" | ||
|
||
export { | ||
shortenText, | ||
generateDaysAgoText | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters