Commit 4f49b647 by OuiAtichat

update init data

parent 9a5bda28
......@@ -117,6 +117,11 @@ class Home extends Component {
isLoading: true,
};
looper = null;
startDate = moment()
.startOf('day')
.valueOf();
endDate = moment().valueOf();
componentDidMount = async () => {
await this.getConfig();
await this.getCurrentUser();
......@@ -183,17 +188,17 @@ class Home extends Component {
getFeedData = async (
deviceId,
selectedRange = {
startDate: moment()
.subtract(1, 'days')
.valueOf(),
endDate: moment().valueOf(),
},
selectedRange = { startDate: this.startDate, endDate: this.endDate },
breakdown = 'minutes'
) => {
const { kairosUrl, userToken } = this.state;
const { startDate, endDate } = selectedRange;
const now = moment().valueOf();
// console.log('now', moment(now).format('D/M/YY HH:mm'));
// console.log('end', moment(endDate).format('D/M/YY HH:mm'));
// console.log('start', moment(startDate).format('D/M/YY HH:mm'));
// console.log(label);
let q_data = {
start_absolute: startDate || now,
end_absolute: endDate || now,
......@@ -331,7 +336,7 @@ class Home extends Component {
revenue: data[4].values[i][1],
remote: data[2].values[i][1],
current: data[5].values[i][1],
timestamp: moment(data[1].values[i][0]).format('D/M/YY H:mm'),
timestamp: moment(data[1].values[i][0]).format('D/M/YY HH:mm'),
};
table.unshift(v);
......
......@@ -20,6 +20,10 @@ class GetDataSelection extends PureComponent {
};
getSelectedRange = selectedRange => {
// console.log('start', moment(selectedRange.startDate).format('D/M/YY HH:mm'));
// console.log('end', moment(selectedRange.endDate).format('D/M/YY HH:mm'));
// console.log('current', moment().format('D/M/YY HH:mm'));
this.setState({ range: selectedRange });
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment