aboutsummaryrefslogtreecommitdiff
path: root/src/utils/moments.ts
diff options
context:
space:
mode:
authorBrian Kim <brian@tagg.id>2021-06-15 17:15:43 +0900
committerBrian Kim <brian@tagg.id>2021-06-15 17:15:43 +0900
commit4a422e43c6a6deaeff5d8fcc692138454653e4b9 (patch)
tree2e86ab879ea35e879581eb64be955d0e5481ff80 /src/utils/moments.ts
parentc57b4959c90cec90dd0936f75a9086a4430b66b1 (diff)
parentdb0678d647f774dcb1cd60513985d9b6fbd0e28b (diff)
Merge with master
Diffstat (limited to 'src/utils/moments.ts')
-rw-r--r--src/utils/moments.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/utils/moments.ts b/src/utils/moments.ts
index 90d69519..9e8cc332 100644
--- a/src/utils/moments.ts
+++ b/src/utils/moments.ts
@@ -19,21 +19,21 @@ export const getTimePosted = (date_time: string) => {
// 1 minute to less than 1 hour
else if (difference >= 60 && difference < 60 * 60) {
difference = now.diff(datePosted, 'minutes');
- time = difference + (difference === 1 ? ' minute' : ' minutes');
+ time = difference + 'm ago';
}
// 1 hour to less than 1 day
else if (difference >= 60 * 60 && difference < 24 * 60 * 60) {
difference = now.diff(datePosted, 'hours');
- time = difference + (difference === 1 ? ' hour' : ' hours');
+ time = difference + 'h ago';
}
// Any number of days
else if (difference >= 24 * 60 * 60 && difference < 24 * 60 * 60 * 3) {
difference = now.diff(datePosted, 'days');
- time = difference + (difference === 1 ? ' day' : ' days');
+ time = difference + 'd ago';
}
// More than 3 days
else if (difference >= 24 * 60 * 60 * 3) {
- time = datePosted.format('MMMM D, YYYY');
+ time = datePosted.format('M-D-YYYY');
}
return time;
};