aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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;
};