Skip to content

Commit

Permalink
fix #809
Browse files Browse the repository at this point in the history
  • Loading branch information
dartcafe committed Feb 18, 2020
1 parent b69f6ce commit f0414f1
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/js/components/SideBar/SideBarTabOptionsDate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<div>
<div class="selectUnit">
<input v-model="move.step">
<Multiselect v-model="move.unit" :options="move.units" />
<Multiselect v-model="move.unit" :options="move.units" label="name" track-by="name" />
</div>
</div>
<div>
Expand Down Expand Up @@ -91,7 +91,14 @@ export default {
move: {
step: 1,
unit: 'week',
units: ['minute', 'hour', 'day', 'week', 'month', 'year']
units: [
{ name: t('polls', 'Minute'), value: 'minute' },
{ name: t('polls', 'Hour'), value: 'hour' },
{ name: t('polls', 'Day'), value: 'day' },
{ name: t('polls', 'Week'), value: 'week' },
{ name: t('polls', 'Month'), value: 'month' },
{ name: t('polls', 'Year'), value: 'year' }
]
}
}
},
Expand Down Expand Up @@ -154,7 +161,7 @@ export default {
const store = this.$store
this.options.list.forEach(function(existingOption) {
const option = Object.assign({}, existingOption)
option.pollOptionText = moment(option.pollOptionText).add(payload.step, payload.unit).format('YYYY-MM-DD HH:mm:ss')
option.pollOptionText = moment(option.pollOptionText).add(payload.step, payload.unit.value).format('YYYY-MM-DD HH:mm:ss')
option.timestamp = moment.utc(option.pollOptionText).unix()
store.dispatch('updateOptionAsync', { option: option })
})
Expand Down

0 comments on commit f0414f1

Please sign in to comment.