Skip to content

Commit 9428209

Browse files
fix: yearly recurrance options - month selection
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
1 parent 4fac1f2 commit 9428209

File tree

1 file changed

+11
-50
lines changed

1 file changed

+11
-50
lines changed

src/components/Editor/Repeat/RepeatFreqYearlyOptions.vue

+11-50
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<NcButton v-for="option in options"
1111
:key="option.value"
1212
class="repeat-option-set-section-grid-item"
13-
:class="option.selected ? 'primary' : 'secondary'"
13+
:type="option.selected ? 'primary' : 'secondary'"
1414
@click="toggleByMonth(option.value)">
1515
{{ option.label }}
1616
</NcButton>
@@ -76,58 +76,19 @@ export default {
7676
computed: {
7777
options() {
7878
const monthNamesShort = getMonthNamesShort()
79+
const options = []
7980

8081
console.debug(this.byMonth)
82+
83+
monthNamesShort.forEach((monthName, index) => {
84+
options.push({
85+
label: monthName,
86+
value: index + 1,
87+
selected: this.byMonth.includes(index + 1),
88+
})
89+
})
8190

82-
return [{
83-
label: monthNamesShort[0],
84-
value: 1,
85-
selected: this.byMonth.includes(1),
86-
}, {
87-
label: monthNamesShort[1],
88-
value: 2,
89-
selected: this.byMonth.includes(2),
90-
}, {
91-
label: monthNamesShort[2],
92-
value: 3,
93-
selected: this.byMonth.includes(3),
94-
}, {
95-
label: monthNamesShort[3],
96-
value: 4,
97-
selected: this.byMonth.includes(4),
98-
}, {
99-
label: monthNamesShort[4],
100-
value: 5,
101-
selected: this.byMonth.includes(5),
102-
}, {
103-
label: monthNamesShort[5],
104-
value: 6,
105-
selected: this.byMonth.includes(6),
106-
}, {
107-
label: monthNamesShort[6],
108-
value: 7,
109-
selected: this.byMonth.includes(7),
110-
}, {
111-
label: monthNamesShort[7],
112-
value: 8,
113-
selected: this.byMonth.includes(8),
114-
}, {
115-
label: monthNamesShort[8],
116-
value: 9,
117-
selected: this.byMonth.includes(9),
118-
}, {
119-
label: monthNamesShort[9],
120-
value: 10,
121-
selected: this.byMonth.includes(10),
122-
}, {
123-
label: monthNamesShort[10],
124-
value: 11,
125-
selected: this.byMonth.includes(11),
126-
}, {
127-
label: monthNamesShort[11],
128-
value: 12,
129-
selected: this.byMonth.includes(12),
130-
}]
91+
return options
13192
},
13293
/**
13394
*

0 commit comments

Comments
 (0)