Use Intl to localise dates and times (#11422)
* Use Intl to generate better internationalised date formats * Get `Yesterday` and `Today` from Intl also * Correct capitalisation blunder * Fix formatTime include weekday * Iterate * Fix tests * use jest setSystemTime * Discard changes to cypress/e2e/settings/general-user-settings-tab.spec.ts * Discard changes to res/css/_components.pcss * Discard changes to res/css/views/elements/_LanguageDropdown.pcss * Discard changes to src/components/views/elements/LanguageDropdown.tsx * Add docs & tests for getDaysArray & getMonthsArray * Discard changes to test/components/structures/__snapshots__/MatrixChat-test.tsx.snap * Consolidate consts * Improve testing & documentation * Update snapshot * Apply suggestions from code review Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> * Iterate * Clarify comments * Update src/DateUtils.ts Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> * Specify hourCycle * Discard changes to test/components/views/settings/devices/DeviceDetails-test.tsx * Update comments --------- Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
This commit is contained in:
parent
d4571aef68
commit
3c52ba0c92
21 changed files with 446 additions and 193 deletions
|
@ -45,7 +45,7 @@ exports[`<MessageEditHistory /> should match the snapshot 1`] = `
|
|||
>
|
||||
<li>
|
||||
<div
|
||||
aria-label="Thu, Jan 1 1970"
|
||||
aria-label="Thu, Jan 1, 1970"
|
||||
class="mx_DateSeparator"
|
||||
role="separator"
|
||||
>
|
||||
|
@ -59,7 +59,7 @@ exports[`<MessageEditHistory /> should match the snapshot 1`] = `
|
|||
aria-hidden="true"
|
||||
class="mx_DateSeparator_dateHeading"
|
||||
>
|
||||
Thu, Jan 1 1970
|
||||
Thu, Jan 1, 1970
|
||||
</h2>
|
||||
</div>
|
||||
<hr
|
||||
|
@ -161,7 +161,7 @@ exports[`<MessageEditHistory /> should support events with 1`] = `
|
|||
>
|
||||
<li>
|
||||
<div
|
||||
aria-label=", NaN NaN"
|
||||
aria-label="Thu, Jan 1, 1970"
|
||||
class="mx_DateSeparator"
|
||||
role="separator"
|
||||
>
|
||||
|
@ -175,7 +175,7 @@ exports[`<MessageEditHistory /> should support events with 1`] = `
|
|||
aria-hidden="true"
|
||||
class="mx_DateSeparator_dateHeading"
|
||||
>
|
||||
, NaN NaN
|
||||
Thu, Jan 1, 1970
|
||||
</h2>
|
||||
</div>
|
||||
<hr
|
||||
|
@ -193,7 +193,7 @@ exports[`<MessageEditHistory /> should support events with 1`] = `
|
|||
<span
|
||||
class="mx_MessageTimestamp"
|
||||
>
|
||||
NaN:NaN
|
||||
00:00
|
||||
</span>
|
||||
<div
|
||||
class="mx_EventTile_content"
|
||||
|
@ -236,7 +236,7 @@ exports[`<MessageEditHistory /> should support events with 1`] = `
|
|||
<span
|
||||
class="mx_MessageTimestamp"
|
||||
>
|
||||
NaN:NaN
|
||||
00:00
|
||||
</span>
|
||||
<div
|
||||
class="mx_EventTile_content"
|
||||
|
@ -290,7 +290,7 @@ exports[`<MessageEditHistory /> should support events with 1`] = `
|
|||
<span
|
||||
class="mx_MessageTimestamp"
|
||||
>
|
||||
NaN:NaN
|
||||
00:00
|
||||
</span>
|
||||
<div
|
||||
class="mx_EventTile_content"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue