Skip to content

Commit

Permalink
fixup! Improve free/busy UI
Browse files Browse the repository at this point in the history
Signed-off-by: Hamza Mahjoubi <[email protected]>
  • Loading branch information
hamza221 committed Feb 28, 2024
1 parent baad706 commit 7670bc2
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/components/Editor/FreeBusy/FreeBusy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
<div class="icon-loading" />
</div>
<div class="modal__content__header">
<h2>{{ t('calendar','Find a time') }}</h2>
<h2>{{ t('calendar', 'Find a time') }}</h2>
<h3>{{ eventTitle }}</h3>
<div class="modal__content__header__attendees">
{{ t('calendar','with') }}
{{ t('calendar', 'with') }}
<NcUserBubble :display-name="organizer.commonName" />
<NcUserBubble v-for="attendee in attendees"
:key="attendee.id"
Expand Down Expand Up @@ -218,6 +218,10 @@ export default {
formattingOptions: { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' },
}
},
mounted() {
const calendar = this.$refs.freeBusyFullCalendar.getApi()
calendar.scrollToTime(this.scrollTime)
},
computed: {
...mapGetters({
timezoneId: 'getResolvedTimezone',
Expand Down Expand Up @@ -251,6 +255,11 @@ export default {

Check warning on line 255 in src/components/Editor/FreeBusy/FreeBusy.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Editor/FreeBusy/FreeBusy.vue#L254-L255

Added lines #L254 - L255 were not covered by tests
return `${startTime} - ${endTime} `
},
scrollTime() {
const options = { hour: '2-digit', minute: '2-digit', seconds: '2-digit', hour12: false}

return this.currentDate.getHours() > 0 ? new Date(this.currentDate.getTime() - 60 * 60 * 1000).toLocaleTimeString(this.lang, options): '10:00:00'

Check warning on line 261 in src/components/Editor/FreeBusy/FreeBusy.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Editor/FreeBusy/FreeBusy.vue#L260-L261

Added lines #L260 - L261 were not covered by tests
},
formattedTimeZoen() {
return this.timezoneId.replace('/', '-')

Check warning on line 264 in src/components/Editor/FreeBusy/FreeBusy.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Editor/FreeBusy/FreeBusy.vue#L263-L264

Added lines #L263 - L264 were not covered by tests
},
Expand Down Expand Up @@ -414,6 +423,7 @@ export default {
break

Check warning on line 423 in src/components/Editor/FreeBusy/FreeBusy.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Editor/FreeBusy/FreeBusy.vue#L423

Added line #L423 was not covered by tests
}
this.currentDate = calendar.getDate()
calendar.scrollToTime(this.scrollTime)
},
},
}
Expand Down

0 comments on commit 7670bc2

Please sign in to comment.