summaryrefslogtreecommitdiffstats
path: root/webapp/components/post_view/components/date_separator.jsx
blob: 4648f456c335f79d396388160ce2c59bc3fd38b5 (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
import PropTypes from 'prop-types';
import React from 'react';
import {FormattedDate} from 'react-intl';

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

DateSeparator.propTypes = {
    date: PropTypes.instanceOf(Date)
};