mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
add defualt calendar
This commit is contained in:
@@ -140,7 +140,7 @@
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<div class="calendar-conteiner-height overflow-hidden" [style.height]="listBoxService.height">
|
||||
<div class="calendar-conteiner-height overflow-hidden" [style.height]="listBoxService.height">
|
||||
<calendar
|
||||
class="calendar-component"
|
||||
[eventSource]="listToPresent"
|
||||
|
||||
@@ -239,6 +239,14 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
|
||||
this.weekToShow()
|
||||
|
||||
this.eventService.registerOnLoadCalendars(()=> {
|
||||
this.setCalendarByDefault(true)
|
||||
const selectedCalendarIds = this.getSelectedAgendaCalendars();
|
||||
this.listToPresent = this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds)
|
||||
|
||||
this.tigerUpdate()
|
||||
})
|
||||
}
|
||||
|
||||
tigerUpdate() {
|
||||
@@ -257,7 +265,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.setCalendarByDefault()
|
||||
this.setCalendarByDefault(false)
|
||||
const selectedCalendarIds = this.getSelectedAgendaCalendars();
|
||||
this.listToPresent = this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds)
|
||||
|
||||
@@ -338,14 +346,20 @@ export class AgendaPage implements OnInit {
|
||||
}, 250)
|
||||
}
|
||||
|
||||
setCalendarByDefault() {
|
||||
if (!this.CalendarName) {
|
||||
if (this.eventService.calendarNamesAry.includes('Meu calendario')) {
|
||||
setCalendarByDefault(force) {
|
||||
if (!this.CalendarName || force) {
|
||||
const prObject = this.eventService.calendarNamesAry.find(e => e?.RoleId == 100000014)
|
||||
|
||||
if(prObject) {
|
||||
console.log({prObject})
|
||||
this.CalendarName = prObject.Fullname
|
||||
} else if (this.eventService.calendarNamesAry.includes('Meu calendario')) {
|
||||
this.CalendarName = 'Meu calendario';
|
||||
} else {
|
||||
this.CalendarName = this.eventService.calendarNamesAry[0]
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Go to the next view of the calendar month/week/day
|
||||
|
||||
Reference in New Issue
Block a user