You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
Merge pull request #6270 from SimonBrandner/fix/presence/17786
Fix hyper-precise presence
This commit is contained in:
@@ -41,11 +41,11 @@ export default class PresenceLabel extends React.Component<IProps> {
|
|||||||
// XXX: This would be better handled using a culture-aware library, but we don't use one yet.
|
// XXX: This would be better handled using a culture-aware library, but we don't use one yet.
|
||||||
private getDuration(time: number): string {
|
private getDuration(time: number): string {
|
||||||
if (!time) return;
|
if (!time) return;
|
||||||
const t = time / 1000;
|
const t = Math.round(time / 1000);
|
||||||
const s = t % 60;
|
const s = t % 60;
|
||||||
const m = t / 60 % 60;
|
const m = Math.round(t / 60) % 60;
|
||||||
const h = t / (60 * 60) % 24;
|
const h = Math.round(t / (60 * 60)) % 24;
|
||||||
const d = t / (60 * 60 * 24);
|
const d = Math.round(t / (60 * 60 * 24));
|
||||||
if (t < 60) {
|
if (t < 60) {
|
||||||
if (t < 0) {
|
if (t < 0) {
|
||||||
return _t("%(duration)ss", { duration: 0 });
|
return _t("%(duration)ss", { duration: 0 });
|
||||||
|
|||||||
Reference in New Issue
Block a user