1
0
mirror of https://github.com/alice-lg/alice-lg.git synced 2024-05-11 05:55:03 +00:00
2017-05-16 13:34:00 +02:00

28 lines
402 B
JavaScript

/**
* Datetime Component
*
* @author Matthias Hannig <mha@ecix.net>
*/
import React from 'react'
import moment from 'moment'
export default class Datetime extends React.Component {
render() {
let timefmt = this.props.format;
if (!timefmt) {
timefmt = 'LLLL';
}
let time = moment(this.props.value);
return (
<span>{time.format(timefmt)}</span>
);
}
}