Skip to content
Snippets Groups Projects
Commit b13fc888 authored by Moritz Strohm's avatar Moritz Strohm
Browse files

fixed removal of exceptions from calendar dates

parent cf80ca9c
No related branches found
No related tags found
No related merge requests found
......@@ -2,11 +2,11 @@
<div class="formpart">
<div class="sr-only" aria-live="polite" ref="list_message_field"></div>
<ul>
<li v-for="date in selected_date_list" v-bind="selected_date_list" :key="date">
<li v-for="date in selected_date_list" v-bind="selected_date_list" :key="getISODate(date)">
<input type="hidden" :name="input_name + '[]'" :value="getISODate(date)">
<studip-date-time :timestamp="Math.floor(date.getTime() / 1000)" :date_only="true"></studip-date-time>
<studip-icon shape="trash" :title="$gettext('Löschen')" @click="removeDate"
class="enter-accessible" aria-role="button" tabindex="0"></studip-icon>
<studip-icon shape="trash" :title="$gettext('Löschen')" @click="removeDate(date)"
class="icon enter-accessible button undecorated" aria-role="button" tabindex="0"></studip-icon>
</li>
</ul>
<label>
......@@ -82,11 +82,15 @@ export default {
this.selected_date_list.push(new Date(reformatted_date));
this.$refs.list_message_field.innerText = $gettextInterpolate($gettext('Datum %{date} hinzugefügt'), {date: this.selected_date_value});
},
removeDate(date_key) {
if (date_key) {
let date = this.selected_date_list.at(date_key);
removeDate(date) {
if (date) {
for (let index in this.selected_date_list) {
if (this.selected_date_list[index] === date) {
this.$delete(this.selected_date_list, index);
}
}
let formatted_date = STUDIP.DateTime.getStudipDate(date, false, true);
this.selected_date_list.splice(date_key, 1);
//this.selected_date_list.splice(date, 1);
this.$refs.list_message_field.innerText = $gettextInterpolate($gettext('Datum %{date} entfernt'), {date: formatted_date});
}
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment