online-judge
online-judge copied to clipboard
Increase Precision on Relative Time Offsets
On things like contests and submissions, relative times are given. Unfortunately, they aren't that precise. "2 hours ago" can mean anything from 1:30 to 2:30.
I was going to PR this, but it seems that the library in use, Moment.js has no real good solution. We use fromNow()
, here's the relevant documentation.
What can be done? Would we find another library? Would we try to hack moment.js? What other options do we have?
What about the built-in Intl.RelativeTimeFormat.prototype.format()
? reference
If the browser doesn't support it (e.g. IE11), just display the absolute time.