Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit 122cbb8

Browse files
Reduce timestamp specificity on profile
Problem: Concern has been expressed about being able to see granular timestamps on the profile page, which would let you see "active 3 seconds ago" or similar. This is public metadata that anyone can access, and we **can not** provide privacy with UI decisions, but the idea that high specificity in the UI is creepy seems fair to me. Solution: Change the display format so that the options are "Today", "Yesterday", "Last $weekday", or the default date formate for the locale in question. Since we aren't hardcoding strings, this should continue to be localized.
1 parent 97ebcff commit 122cbb8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/depject/message/html/timestamp.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ exports.create = function (api) {
1919
title: moment(api.message.sync.timestamp(msg)).format('LLLL zz')
2020
}, moment(api.message.sync.timestamp(msg)).fromNow())
2121
} else {
22-
return moment(api.message.sync.timestamp(msg)).fromNow()
22+
return moment(api.message.sync.timestamp(msg)).calendar(null, {
23+
sameDay: '[Today]',
24+
lastDay: '[Yesterday]',
25+
lastWeek: '[Last] dddd'
26+
})
2327
}
2428
}
2529
}

0 commit comments

Comments
 (0)