summaryrefslogtreecommitdiffstats
path: root/webapp/components/post_view/date_separator.jsx
blob: 3f5184dbf2265104d4161f28ffaf89e111987e47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import React from 'react';
import PropTypes from 'prop-types';
import {FormattedDate} from 'react-intl';

export default class DateSeparator extends React.PureComponent {
    static propTypes = {

        /*
         * The date to display in the separator
         */
        date: PropTypes.instanceOf(Date)
    }

    render() {
        return (
            <div
                className='date-separator'
            >
                <hr className='separator__hr'/>
                <div className='separator__text'>
                    <FormattedDate
                        value={this.props.date}
                        weekday='short'
                        month='short'
                        day='2-digit'
                        year='numeric'
                    />
                </div>
            </div>
        );
    }
}