Skip to content
Snippets Groups Projects
Verified Commit 7deed039 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Fix first time mode and make it configurable

parent 991f32b5
No related branches found
No related tags found
1 merge request!1304Refactor calendar overview in more different components
......@@ -15,7 +15,7 @@
:events="events"
:type="internalCalendarType"
:event_color="getColorForEvent"
:first-time="firstTime"
:first-time="startWithFirstTime ? firstTime : undefined"
interval-height="60"
@click:date="viewDay"
@click:day="viewDay"
......@@ -69,6 +69,12 @@ export default {
required: false,
default: null,
},
// Start the calendar with the time of the first starting calendar event
startWithFirstTime: {
type: Object,
required: false,
default: () => false,
},
},
data() {
return {
......@@ -106,8 +112,10 @@ export default {
computed: {
rangeDateTime() {
return {
start: this.range.start ? this.$parseISODate(this.range.start) : null,
end: this.range.end ? this.$parseISODate(this.range.end) : null,
start: this.range.start
? this.$parseISODate(this.range.start.date)
: null,
end: this.range.end ? this.$parseISODate(this.range.end.date) : null,
};
},
events() {
......
......@@ -30,6 +30,7 @@
@changeCalendarType="setCalendarType"
v-bind="$attrs"
ref="calendar"
:startWithFirstTime="startWithFirstTime"
/>
</div>
</template>
......@@ -52,6 +53,11 @@ export default {
type: Array,
required: true,
},
startWithFirstTime: {
type: Object,
required: false,
default: () => true,
},
},
};
</script>
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