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

Improve date formatting in log view.

This commit is contained in:
Jari Bakken 2015-02-04 17:47:37 +00:00 committed by Ivar Conradi Østhus
parent 12710a6d04
commit c15b72666b
2 changed files with 12 additions and 5 deletions

View File

@ -45,6 +45,7 @@
"jsxhint": "0.4.15",
"knex": "^0.7.3",
"log4js": "0.6.21",
"moment": "^2.9.0",
"nconf": "0.6.9",
"pg": "3.6.1",
"react": "^0.12.0",
@ -68,7 +69,12 @@
},
"jest": {
"scriptPreprocessor": "<rootDir>/jest-preprocessor.js",
"unmockedModulePathPatterns": ["<rootDir>/node_modules/react"],
"moduleFileExtensions": ["jsx", "js"]
"unmockedModulePathPatterns": [
"<rootDir>/node_modules/react"
],
"moduleFileExtensions": [
"jsx",
"js"
]
}
}

View File

@ -1,4 +1,5 @@
var React = require('react');
var moment = require('moment');
var DIFF_PREFIXES = {
A: ' ',
@ -20,13 +21,13 @@ var LogEntry = React.createClass({
},
render: function() {
var d = new Date(this.props.event.createdAt);
var date = moment(this.props.event.createdAt);
return (
<tr>
<td>
{d.getDate() + "." + (d.getMonth() + 1) + "." + d.getFullYear()}<br />
kl. {d.getHours() + "." + d.getMinutes()}
{date.format('ll')}<br />
{date.format('HH:mm')}
</td>
<td>
<strong>{this.props.event.data.name}</strong><em>[{this.props.event.type}]</em>