Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
toiletcoin
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
atichat
toiletcoin
Commits
4f49b647
Commit
4f49b647
authored
Aug 08, 2019
by
OuiAtichat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update init data
parent
9a5bda28
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
7 deletions
+16
-7
src/Pages/Home.js
+12
-7
src/components/GetDataSelection/GetDataSelection.js
+4
-0
No files found.
src/Pages/Home.js
View file @
4f49b647
...
...
@@ -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 H
H
:mm'
),
};
table
.
unshift
(
v
);
...
...
src/components/GetDataSelection/GetDataSelection.js
View file @
4f49b647
...
...
@@ -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
});
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment