1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-20 00:08:02 +01:00

Merge pull request #41 from Unleash/date

Render date as DD.MM.YYYY
This commit is contained in:
Ivar Conradi Østhus 2017-01-05 16:25:06 +01:00 committed by GitHub
commit fe8fb45603

View File

@ -6,6 +6,10 @@ import { HeaderTitle, SwitchWithLabel } from '../common';
import style from './history.scss'; import style from './history.scss';
const dateOptions = { day: '2-digit', month: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit', second: '2-digit' };
const formatDate = v => (new Date(v)).toLocaleString('nb-NO', dateOptions);
class HistoryList extends Component { class HistoryList extends Component {
toggleShowDiff () { toggleShowDiff () {
@ -36,7 +40,7 @@ class HistoryList extends Component {
<TableHeader name="type">Type</TableHeader> <TableHeader name="type">Type</TableHeader>
<TableHeader name="createdBy">User</TableHeader> <TableHeader name="createdBy">User</TableHeader>
<TableHeader name="diff">Diff</TableHeader> <TableHeader name="diff">Diff</TableHeader>
<TableHeader numeric name="createdAt" cellFormatter={(v) => (new Date(v)).toLocaleString('nb-NO')}>Time</TableHeader> <TableHeader numeric name="createdAt" cellFormatter={formatDate}>Time</TableHeader>
</Table>); </Table>);
} }