Skip to content

Commit

Permalink
set time on load
Browse files Browse the repository at this point in the history
  • Loading branch information
karliky committed May 5, 2020
1 parent 87b8f44 commit e50c86c
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/renderer/components/sections/environment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
min="0"
max="1"
step="0.005"
value="0.5">
value="0.5"
ref="hour"
>
</p>
</div>
<div class="field">
Expand All @@ -43,7 +45,9 @@
min="0"
max="1"
step="0.005"
value="0.5">
value="0.5"
ref="minutes"
>
</p>
</div>
</div>
Expand Down Expand Up @@ -81,6 +85,16 @@
<script>
export default {
name: 'environment',
mounted() {
const hourEl = this.$refs.hour;
const minutesEl = this.$refs.minutes;
const currentHour = this.$store.state.environment.timeOfDay.hour;
const currentMinutes = this.$store.state.environment.timeOfDay.minutes;
const toHour = (currentHour * 3600) / 86400;
const toMinutes = (currentMinutes * 60) / 3600;
hourEl.value = toHour;
minutesEl.value = toMinutes;
},
methods: {
setTimeOfDayStatus ({ target: element }) {
const isChecked = element.checked;
Expand Down

0 comments on commit e50c86c

Please sign in to comment.