Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordartcafe <github@dartcafe.de>2022-04-24 23:32:43 +0300
committerdartcafe <github@dartcafe.de>2022-04-24 23:32:43 +0300
commit9c665a5f075f3bf5dc2e85ab3d9fb3d042866f79 (patch)
tree0c43579004bf4fcd2d7935cda40d4b7c66148f96 /src/js/components/Options
parent17d0f20890b8c351dce8bfa356b6f08199588442 (diff)
some more refactorsref/add-validators
Signed-off-by: dartcafe <github@dartcafe.de>
Diffstat (limited to 'src/js/components/Options')
-rw-r--r--src/js/components/Options/OptionItem.vue50
1 files changed, 24 insertions, 26 deletions
diff --git a/src/js/components/Options/OptionItem.vue b/src/js/components/Options/OptionItem.vue
index 5a9253f5..27bffef8 100644
--- a/src/js/components/Options/OptionItem.vue
+++ b/src/js/components/Options/OptionItem.vue
@@ -30,41 +30,39 @@
<div v-if="show === 'textBox'"
v-tooltip.auto="optionTooltip"
class="option-item__option--text"
- v-html="optionText">
- {{ optionText }}
- </div>
+ v-html="optionText" />
<!-- eslint-enable vue/no-v-html -->
<div v-if="show === 'dateBox'" v-tooltip.auto="dateLocalFormatUTC" class="option-item__option--datebox">
<div class="event-date">
<div class="event-from">
<div class="month">
- {{ event.from.month }}
+ {{ eventOption.from.month }}
</div>
<div class="day">
- {{ event.from.dow }} {{ event.from.day }}
+ {{ eventOption.from.dow }} {{ eventOption.from.day }}
</div>
- <div v-if="!event.dayLong" class="time">
- {{ event.from.time }}
- <span v-if="!event.dayLong && option.duration && event.to.sameDay">
- - {{ event.to.time }}
+ <div v-if="!eventOption.dayLong" class="time">
+ {{ eventOption.from.time }}
+ <span v-if="!eventOption.dayLong && option.duration && eventOption.to.sameDay">
+ - {{ eventOption.to.time }}
</span>
</div>
</div>
- <div v-if="option.duration && !event.to.sameDay" class="devider">
+ <div v-if="option.duration && !eventOption.to.sameDay" class="devider">
-
</div>
- <div v-if="option.duration && !event.to.sameDay" class="event-to">
+ <div v-if="option.duration && !eventOption.to.sameDay" class="event-to">
<div class="month">
- {{ event.to.month }}
+ {{ eventOption.to.month }}
</div>
<div class="day">
- {{ event.to.dow }} {{ event.to.day }}
+ {{ eventOption.to.dow }} {{ eventOption.to.day }}
</div>
- <div v-if="!event.dayLong" class="time">
- {{ event.to.time }}
+ <div v-if="!eventOption.dayLong" class="time">
+ {{ eventOption.to.time }}
</div>
</div>
</div>
@@ -120,7 +118,7 @@ export default {
return this.draggable
},
- event() {
+ eventOption() {
const from = moment.unix(this.option.timestamp)
const to = moment.unix(this.option.timestamp + Math.max(0, this.option.duration))
// does the event start at 00:00 local time and
@@ -168,30 +166,30 @@ export default {
}
if (this.option.duration === 0) {
- return this.event.from.dateTime
+ return this.eventOption.from.dateTime
}
- if (this.event.dayLong && this.event.to.sameDay) {
- return this.event.from.date
+ if (this.eventOption.dayLong && this.eventOption.to.sameDay) {
+ return this.eventOption.from.date
}
- if (this.event.dayLong && !this.event.to.sameDay) {
- return `${this.event.from.date} - ${this.event.to.date}`
+ if (this.eventOption.dayLong && !this.eventOption.to.sameDay) {
+ return `${this.eventOption.from.date} - ${this.eventOption.to.date}`
}
- if (this.event.to.sameDay) {
- return `${this.event.from.dateTime} - ${this.event.to.time}`
+ if (this.eventOption.to.sameDay) {
+ return `${this.eventOption.from.dateTime} - ${this.eventOption.to.time}`
}
- return `${this.event.from.dateTime} - ${this.event.to.dateTime}`
+ return `${this.eventOption.from.dateTime} - ${this.eventOption.to.dateTime}`
},
dateLocalFormatUTC() {
if (this.option.duration) {
- return `${this.event.from.utc} - ${this.event.to.utc} UTC`
+ return `${this.eventOption.from.utc} - ${this.eventOption.to.utc} UTC`
}
- return `${this.event.from.utc} UTC`
+ return `${this.eventOption.from.utc} UTC`
},
optionTooltip() {