# Relative date format issue

**URL:** https://meta.discourse.org/t/relative-date-format-issue/323601
**Category:** UX
**Created:** [August 27, 2024, 4:16pm UTC](https://meta.discourse.org/t/relative-date-format-issue/323601 "2024-08-27T16:16:26Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Rick\_Jing](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rick_jing/32/354677_2.png) [@Rick\_Jing](https://meta.discourse.org/u/Rick_Jing)
#### Post date: [August 27, 2024, 4:16pm UTC](https://meta.discourse.org/t/relative-date-format-issue/323601/1 "2024-08-27T16:16:26Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/4X/5/b/9/5b976237b4e2f00b50eff1e131ce1760a19a2ec3.png)

 ![image](https://global.discourse-cdn.com/meta/original/4X/8/7/6/8769ce67bb2a31e185a17700f340041f47b707e7.png)

The relative date in Chinese language has unnecessary spaces.  
Usually the date format should be **“mm月dd日”** , the current format is **“mm月 dd 日”**.  
I haven’t found any issue with the translation, and also I think the ember helper lead to this issue.

> <https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/lib/formatter.js>

I think function **autoUpdatingRelativeAge** adds the extra spaces.  
I understand this is not an issue for English version discourse, but may cause some format issues for other languages.  
I tried javascript to remove the spaces, but it won’t work with the lazy loading content.  
I’m appreciated to any tips for modifying the ember helper in a plugin or any fix from the main branch.

---

<div class="post-metadata">

### Author: ![Alteras](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alteras/32/179824_2.png) [@Alteras](https://meta.discourse.org/u/Alteras)
#### Post date: [August 27, 2024, 11:17pm UTC](https://meta.discourse.org/t/relative-date-format-issue/323601/2 "2024-08-27T23:17:57Z")

</div>

This seems to be a #Contribute > Bug with simplified chinese caused by the date format strings in the locale files. Looking at the git history, in v3.3.0, the format is:

> <https://github.com/discourse/discourse/blob/v3.3.0/config/locales/client.zh_CN.yml#L33>

> <https://github.com/discourse/discourse/blob/v3.3.0/config/locales/client.zh_CN.yml#L67-L68>

It looks like they were updated recently to (confirmed live in 3.4.0.beta1-dev)

> <https://github.com/discourse/discourse/blob/6136a275dd6b6028488ca9bb5b5f941d96048939/config/locales/client.zh_CN.yml#L33>

> <https://github.com/discourse/discourse/blob/6136a275dd6b6028488ca9bb5b5f941d96048939/config/locales/client.zh_CN.yml#L67-L68>

Testing the format string `"MMM D 日"` against with the default [Momentjs config for `zh-cn`](https://github.com/moment/moment/blob/18aba135ab927ffe7f868ee09276979bed6993a6/locale/zh-cn.js) in a codepen, it is producing the observed defect (ie `"8月 2 日"`)

For immediate fix, you can change the format via the translation for `js.dates.tiny.date_month` and `js.dates.long_no_year_no_time` as so:

 ![image](https://global.discourse-cdn.com/meta/original/4X/c/1/4/c14b9b4dbd7dc93e9ea0bb560fb479db4d00c722.png)

 ![image](https://global.discourse-cdn.com/meta/original/4X/b/2/e/b2ee09329e5324ee61cc36e874814f126edcafd8.png)
