Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HydroMinderApp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cs21-32
HydroMinderApp
Commits
2ded959c
Commit
2ded959c
authored
3 years ago
by
Myśliwiec, D. (Dominik, Student M-CS)
Browse files
Options
Downloads
Patches
Plain Diff
Fix the days to start from monday
parent
ff109fd0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#7241
failed
3 years ago
Stage: build
Stage: test
Stage: test1
Stage: test2
Stage: test3
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
components/WeekChart.vue
+7
-4
7 additions, 4 deletions
components/WeekChart.vue
with
7 additions
and
4 deletions
components/WeekChart.vue
+
7
−
4
View file @
2ded959c
...
...
@@ -60,6 +60,7 @@ export default {
noData
:
'
Loading...
'
},
weekData
:
{},
weekConsumption
:
[],
bestDay
:
'
monday
'
,
}
},
...
...
@@ -67,11 +68,13 @@ export default {
const
weekDataResponse
=
await
this
.
$axios
.
get
(
'
/api/consumption/average-graph
'
+
'
?precision=week
'
)
this
.
weekData
=
weekDataResponse
.
data
const
days
=
[
'
sunday
'
,
'
monday
'
,
'
tuesday
'
,
'
wednesday
'
,
'
thursday
'
,
'
friday
'
,
'
saturday
'
,
'
sunday
'
]
this
.
weekConsumption
=
this
.
weekData
.
moments
.
map
(
moment
=>
moment
.
average
)
this
.
weekConsumption
.
push
(
this
.
weekConsumption
.
shift
())
const
days
=
[
'
monday
'
,
'
tuesday
'
,
'
wednesday
'
,
'
thursday
'
,
'
friday
'
,
'
saturday
'
,
'
sunday
'
]
let
max
=
0
for
(
let
i
=
0
;
i
<
7
;
i
++
)
{
if
((
this
.
week
Data
.
moments
.
map
(
moment
=>
moment
.
average
)
[
i
])
>
max
)
{
max
=
this
.
week
Data
.
moments
.
map
(
moment
=>
moment
.
average
)
[
i
]
if
((
this
.
week
Consumption
[
i
])
>
max
)
{
max
=
this
.
week
Consumption
[
i
]
this
.
bestDay
=
days
[
i
]
}
}
...
...
@@ -84,7 +87,7 @@ export default {
}
return
[{
name
:
'
average
'
,
data
:
this
.
week
Data
.
moments
.
map
(
moment
=>
moment
.
average
)
data
:
this
.
week
Consumption
}]
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment