Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
secondary: '#D1E8FF'
},
yellow: {
primary: '#e3bc08',
secondary: '#FDF1BA'
}
};
@Component({
selector: 'app-home',
changeDetection: ChangeDetectionStrategy.OnPush,
templateUrl: './schedule.component.html',
styleUrls: ['./schedule.component.scss']
})
export class ScheduleComponent implements OnInit, AfterViewInit, OnDestroy {
view: CalendarView = CalendarView.Day;
CalendarView = CalendarView;
refresh: Subject = new Subject();
viewDate: Date = new Date();
events: CalendarEvent[] = [];
minHour = 8;
maxHour = 20;
constructor(private storageService: StorageService) {
}
ngOnInit() {
const calendarEvents = this.storageService.getItem('inception.calendar');
if (!isEmpty(calendarEvents)) {
// tslint:disable-next-line:prefer-for-of
for (let i = 0; i < calendarEvents.length; i++) {
import { Component, ChangeDetectionStrategy } from '@angular/core';
import { CalendarEvent, CalendarView } from 'angular-calendar';
@Component({
selector: 'mwl-demo-component',
changeDetection: ChangeDetectionStrategy.OnPush,
templateUrl: 'template.html'
})
export class DemoComponent {
view: CalendarView = CalendarView.Day;
viewDate: Date = new Date();
events: CalendarEvent[] = [];
}
switch (this.view) {
case RunboxCalendarView.Overview: {
this.mwlView = null;
break;
}
case RunboxCalendarView.Month: {
this.mwlView = CalendarView.Month;
break;
}
case RunboxCalendarView.Week: {
this.mwlView = CalendarView.Week;
break;
}
case RunboxCalendarView.Day: {
this.mwlView = CalendarView.Day;
break;
}
}
}
import { Component, ChangeDetectionStrategy } from '@angular/core';
import { CalendarEvent, CalendarView } from 'angular-calendar';
import { setHours, setMinutes } from 'date-fns';
import { colors } from '../demo-utils/colors';
@Component({
selector: 'mwl-demo-component',
changeDetection: ChangeDetectionStrategy.OnPush,
templateUrl: 'template.html'
})
export class DemoComponent {
view: CalendarView = CalendarView.Day;
viewDate: Date = new Date();
events: CalendarEvent[] = [
{
title: 'No event end date',
start: setHours(setMinutes(new Date(), 0), 3),
color: colors.blue
},
{
title: 'No event end date',
start: setHours(setMinutes(new Date(), 0), 5),
color: colors.yellow
}
];
}
changeDay(date: Date) {
this.viewDate = date;
this.view = CalendarView.Day;
}
}