Relative timestamps (<t:…:R>) show wrong direction and size past ~4 weeks ("in 0 months" for a date 2 years ago)
Les mainteneurs répondent en général sous 1 jour
@MuhammadFaizan-prog y travaille déjà.
Depuis le 14/11/2026.
- #1426 par @MuhammadFaizan-prog — ouverte
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 35/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- À l'abandon
- Stack technique
- javascript
- Domaine
- frontend
Piste de recherche
Read timeAgo in packages/markups/src/elements/TimestampElement.js; the seconds-through-weeks branches are correct, so focus on the months and years branches that subtract only getMonth() / getFullYear() and lose the sign. Run the existing markup tests for TimestampElement with the four examples from the issue (36 days, 13 months, exactly 2 years, 66 days future) to confirm the failures before changing the elapsed-month calculation and rounding. Note that pull request #1426 is already open against this issue, so check its state before starting.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Description:
Relative timestamp markup (<t:UNIX:R>) is rendered by timeAgo in packages/markups/src/elements/TimestampElement.js. Seconds through weeks are derived from the elapsed time, but months and years are computed by subtracting only the calendar month and year numbers (getMonth() / getFullYear()). Once a timestamp is 4+ weeks away, the result ignores the year and gets the wrong sign across New Year:
- 36 days ago (Dec 20 viewed on Jan 25) → "in 11 months"
- 13 months ago → "1 month ago"
- exactly 2 years ago (same calendar month) → "in 0 months"
- 66 days in the future (Jan 20 viewed on Nov 15) → "10 months ago"
Steps to reproduce:
- During November 2026, send a message containing
<t:1731672000:R>(Nov 15 2024). - Send
<t:1760529600:R>(Oct 15 2025) and<t:1768867200:R>(Jan 20 2027). - Look at the rendered timestamps in EmbeddedChat.
Expected behavior:
"2 years ago", "1 year ago" and "in 2 months".
Actual behavior:
"in 0 months", "1 month ago" and "10 months ago".
- Langage dominant
- JavaScript
- Étoiles
- 170
- Forks
- 397
- Merge moyen
- 12 j 14 h
- PR mergées (30 j)
- 6
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Aucun guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de RocketChat/EmbeddedChat
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
RocketChat/EmbeddedChat#1429 ·
Les mainteneurs répondent en général sous 1 jour
-
docs: README says Node 22 is required, but .nvmrc pins v24 and preinstall enforces itPeut-être pris @Veerpratapgupta l’a pris il y a 29 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
RocketChat/EmbeddedChat#1377 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
test: isMessageSequential in layout_editor has no coveragePeut-être à nouveau libre Une pull request pour cette issue a été fermée sans être fusionnée. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
RocketChat/EmbeddedChat#1373 ·
Les mainteneurs répondent en général sous 1 jour
-
Permissions change-detection in useFetchChatData is dead — applyPermissions re-runs on every callPeut-être pris @yash113gadia l’a pris il y a 166 jours. Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
RocketChat/EmbeddedChat#1317 ·
Les mainteneurs répondent en général sous 1 jour
-
Only the last emoji shortname in a message is converted to unicodePeut-être pris @yash113gadia l’a pris il y a 167 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
RocketChat/EmbeddedChat#1315 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de RocketChat/EmbeddedChat
Issues similaires
-
Out of order / duplicate key error shows the key bytes as decimal or UTF-8, not hexPeut-être pris @bardrop l’a pris aujourd’hui. Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 86/100
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 80/100
Les mainteneurs répondent en général sous 3 jours
-
`remix-hook-form/middleware` imports `unstable_createContext`, breaking on `react-router` >= 7.9.0Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
code-forge-io/remix-hook-form#189 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100