Add configuration to disable relative date markers in timeline (#7405)

* add disabler elative dates setting

Signed-off-by: Kerry Archibald <kerrya@element.io>

* test existing DateSeparator

Signed-off-by: Kerry Archibald <kerrya@element.io>

* use full date format when TimelineDisableRelativeDates is truthy

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add comment

Signed-off-by: Kerry Archibald <kerrya@element.io>

* flip timelineDisableRelativeDates -> timelineEnableRelativeDates to fit convention

Signed-off-by: Kerry Archibald <kerrya@element.io>

* mock date constructor in test

Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
Kerry 2021-12-21 10:08:22 +01:00 committed by GitHub
parent b90a0c443d
commit 61e3c38b19
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 142 additions and 4 deletions

View file

@ -0,0 +1,32 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`DateSeparator renders the date separator correctly 1`] = `
<Wrapper
now="2021-12-17T08:09:00.000Z"
ts={1639728540000}
>
<DateSeparator
now="2021-12-17T08:09:00.000Z"
ts={1639728540000}
>
<h2
aria-label="Today"
className="mx_DateSeparator"
role="separator"
tabIndex={-1}
>
<hr
role="none"
/>
<div
aria-hidden="true"
>
Today
</div>
<hr
role="none"
/>
</h2>
</DateSeparator>
</Wrapper>
`;