Show full date

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2021-02-25 08:20:34 +01:00
parent 83de84972e
commit b18622efe4
No known key found for this signature in database
GPG key ID: 9760693FDD98A790
2 changed files with 9 additions and 4 deletions

View file

@ -23,13 +23,18 @@ export default class MessageTimestamp extends React.Component {
static propTypes = {
ts: PropTypes.number.isRequired,
showTwelveHour: PropTypes.bool,
showFullDate: PropTypes.bool,
};
render() {
const date = new Date(this.props.ts);
return (
<span className="mx_MessageTimestamp" title={formatFullDate(date, this.props.showTwelveHour)} aria-hidden={true}>
{ formatTime(date, this.props.showTwelveHour) }
{
this.props.showFullDate ?
formatFullDate(date, this.props.showTwelveHour) :
formatTime(date, this.props.showTwelveHour)
}
</span>
);
}