Prompted by @TheMusicalNinja mistaking “Apr 17” for “Apr '17”, and @plantron’s suggestion that Discourse should change their format.
What
Examples of the default timestamps are:
3m
, 5h
, 1d
, Apr 17
, Apr '17
As you see they tell us as little as possible and can easily cause confusion. This script provides more detailed timestamps. The table below uses relative time for anything less than 4 hours old, and relative dates for anything less than 7 day old. Where it stops being relative is, however, a setting at the top of the script, just like short format and 12- or 24-hour times are.
Let’s assume a post was posted 6:55 AM August 16, 2016.
Time since post | Forum Default | Short Format 12h | Short Format 24h | Long Format 12h | Long Format 24h |
---|---|---|---|---|---|
30 seconds | 1m | < 1m | < 1m | < 1 minute | < 1 minute |
5 minutes | 5m | 5m | 5m | 5 minutes | 5 minutes |
1h 10m | 1h | 1h 10m | 1h 10m | 1 hour 10 minutes | 1 hour 10 minutes |
3h 31m | 4h | 3h 31m | 3h 31m | 3 hours 31 minutes | 3 hours 31 minutes |
4h 50m | 5h | 6:55 AM | 06:55 | Today at 6:55 AM | Today at 06:55 |
1d 1h | 1d | 1d, 6:55 AM | 1d, 06:55 | Yesterday at 6:55 AM | Yesterday at 06:55 |
2d 3h | 2d | 2d, 6:55 AM | 2d, 06:55 | 2 days, 6:55 AM | 2 days, 06:55 |
8d | 8d | Aug 16 6:55 AM | Aug 16 06:55 | Aug 16 6:55 AM | Aug 16 06:55 |
2 months | Aug 16 | Aug 16 6:55 AM | Aug 16 06:55 | Aug 16 6:55 AM | Aug 16 06:55 |
1 year | Aug '16 | Aug 16, 2016 | Aug 16, 2016 | Aug 16, 2016 | Aug 16, 2016 |
The available settings are:
AmPmTimes: true
or false
depending on whether you’re on 12-hour or 24-hour clock.
shortFormat: true
or false
depending on whether you want d
, h
, m
, s
, instead of the full words.
relativeHours: the number
of hours you want to be relative before it starts displaying the exact time.
relativeDays: the number
of dates you want to be relative before it starts displaying the exact date.
Where
→ https://greasyfork.org/en/scripts/371251-wanikani-forums-detailed-timestamps ←
I’m open to suggestions if you think anything should be changed.