Skip to content

Commit

Permalink
Update date format (#52)
Browse files Browse the repository at this point in the history
* Support of float input type

* Disabled autocomplete in input fields

* Removed annoying Input spinners

https://codepen.io/ahastudio/pen/eVovMv

* Prevents change of numbers with mouse wheel

mui/material-ui#7960

* Removed number scrolling on keyboard arrow

* Backend bug fix

* Prettified "cross-remove" button

* Added \n to newfile

* Updated displayed datetime format

* Revert "Updated displayed datetime format"

This reverts commit a432546.

* first version of correct datetime in operation editor

* Updated and used function utcTimeToLocal

* Fixed bug updated/created

Co-authored-by: Dmitry Brazhenko <[email protected]>
Co-authored-by: Ivan Khomyakov <[email protected]>
  • Loading branch information
3 people authored Jun 2, 2020
1 parent 5ad98db commit 24bd2ce
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
3 changes: 3 additions & 0 deletions scripts/ssh_to_frontend.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

docker exec -it $(docker ps | grep front | cut -f1 -d " ") sh
2 changes: 1 addition & 1 deletion ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions ui/src/components/Node/NodeProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { NODE_STATUS, COLLECTIONS } from '../../constants';
import ParameterItem from '../Common/ParameterItem';
import makePropertiesBox from '../Common/makePropertiesBox';
import './NodeProperties.css';

import { utcTimeToLocal } from '../../utils';

function makeKeyValueRow(name, value, key) {
return (
Expand Down Expand Up @@ -77,10 +77,11 @@ export default class NodeProperties extends Component {
/>
);


const statePropertiesItems = [
makeKeyValueRow('Node Status', <i>{this.state.nodeStatus}</i>, 'node_status'),
makeKeyValueRow('Created', <i>{this.props.created}</i>, 'created'),
makeKeyValueRow('Updated', <i>{this.props.updated}</i>, 'updated'),
makeKeyValueRow('Created', <i>{utcTimeToLocal(this.props.created)}</i>, 'created'),
makeKeyValueRow('Updated', <i>{utcTimeToLocal(this.props.updated)}</i>, 'updated'),
];

const inheritancePropertiesItems = [
Expand Down
10 changes: 7 additions & 3 deletions ui/src/utils.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
var dateFormat = require('dateformat');

export function storeToClipboard(text) {
localStorage.setItem('clipboard', JSON.stringify(text));
}
Expand All @@ -6,9 +8,11 @@ export function loadFromClipboard() {
return JSON.parse(localStorage.getItem('clipboard'));
}

export function utcTimeToLocal(text) {
const date = new Date(text + 'Z'); // Make date it UTC
return date.toString().replace(/GMT.*/g, ''); // RM GMT...
export function utcTimeToLocal(text, outputFormat="yyyy-mm-dd HH:MM:ss") {
//const date = new Date(text + 'Z'); // Make date it UTC
//return date.toString().replace(/GMT.*/g, ''); // RM GMT... //Fri May 29 2020 23:05:45
var date= Date.parse(text + "GMT")
return dateFormat(date, outputFormat).toString()
}

export function addStyleToTourSteps(steps) {
Expand Down

0 comments on commit 24bd2ce

Please sign in to comment.