online-judge icon indicating copy to clipboard operation
online-judge copied to clipboard

Increase Precision on Relative Time Offsets

Open Riolku opened this issue 3 years ago • 1 comments

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?

Riolku avatar Feb 22 '22 01:02 Riolku

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.

int-y1 avatar Jun 14 '22 04:06 int-y1