Refactor charts

This commit is contained in:
Thomas Nordquist
2019-07-11 22:05:02 +02:00
parent 05867dab48
commit df3e0fc047
8 changed files with 204 additions and 45 deletions

View File

@@ -5,6 +5,7 @@ import { connect } from 'react-redux'
interface Props {
date: Date
timeFirst?: boolean
overrideLocale?: string
locale?: string
intervalSince?: Date
@@ -30,7 +31,7 @@ class DateFormatter extends React.PureComponent<Props, {}> {
private localizedDate(locale: string) {
return moment(this.props.date)
.locale(locale)
.format('L LTS')
.format(this.props.timeFirst ? 'LTS L' : 'L LTS')
}
private unitForInterval(milliseconds: number) {