From a432546bc5eb819b81ac9632c4a40d96b6ae908e Mon Sep 17 00:00:00 2001 From: Dmitry Brazhenko Date: Fri, 29 May 2020 01:06:59 +0300 Subject: [PATCH] Updated displayed datetime format --- ui/package-lock.json | 5 +++++ ui/package.json | 1 + ui/src/components/Node/NodeProperties.js | 6 +++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ui/package-lock.json b/ui/package-lock.json index 65b33f79..871ca83f 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -4457,6 +4457,11 @@ } } }, + "dateformat": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", + "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==" + }, "debug": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", diff --git a/ui/package.json b/ui/package.json index 9fe18789..6f92d3bd 100644 --- a/ui/package.json +++ b/ui/package.json @@ -9,6 +9,7 @@ "bson": "^4.0.2", "classnames": "^2.2.6", "cryptiles": "^4.1.3", + "dateformat": "^3.0.3", "deep-extend": "^0.6.0", "eslint-config-airbnb-base": "^13.2.0", "eslint-import-resolver-webpack": "^0.11.1", diff --git a/ui/src/components/Node/NodeProperties.js b/ui/src/components/Node/NodeProperties.js index e5f648d9..2f1c6e01 100644 --- a/ui/src/components/Node/NodeProperties.js +++ b/ui/src/components/Node/NodeProperties.js @@ -5,7 +5,7 @@ import { NODE_STATUS, COLLECTIONS } from '../../constants'; import ParameterItem from '../Common/ParameterItem'; import makePropertiesBox from '../Common/makePropertiesBox'; import './NodeProperties.css'; - +var dateFormat = require('dateformat'); function makeKeyValueRow(name, value, key) { return ( @@ -79,8 +79,8 @@ export default class NodeProperties extends Component { const statePropertiesItems = [ makeKeyValueRow('Node Status', {this.state.nodeStatus}, 'node_status'), - makeKeyValueRow('Created', {this.props.created}, 'created'), - makeKeyValueRow('Updated', {this.props.updated}, 'updated'), + makeKeyValueRow('Created', {dateFormat(Date.parse(this.props.created), "yyyy-mm-dd HH:MM:ss")}, 'created'), + makeKeyValueRow('Updated', {dateFormat(Date.parse(this.props.created), "yyyy-mm-dd HH:MM:ss")}, 'updated'), ]; const inheritancePropertiesItems = [