Skip to content

Commit

Permalink
Adjusting initialisation variables for better dynamic handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
Grant Brits committed Jan 14, 2018
1 parent 824e21b commit 5b1e69e
Showing 1 changed file with 7 additions and 22 deletions.
29 changes: 7 additions & 22 deletions src/calendar/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,39 +38,24 @@ import * as _ from "lodash";
export class Calendar {

@Output() onDaySelect = new EventEmitter<dateObj>();

@Output() onMonthSelect = new EventEmitter<any>();

@Input() events: Array<singularDate> = [];

currentYear: number;

currentMonth: number;

currentDate: number;

currentDay: number;
currentYear: number = moment().year();
currentMonth: number = moment().month();
currentDate: number = moment().date();
currentDay: number = moment().day();

displayYear: number;

displayMonth: number;
displayYear: number = moment().year();
displayMonth: number = moment().month();

dateArray: Array<dateObj> = []; // Array for all the days of the month

weekArray = []; // Array for each row of the calendar

lastSelect: number = 0; // Record the last clicked location

weekHead: string[] = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];


constructor() {
this.currentYear = moment().year();
this.currentMonth = moment().month();
this.currentDate = moment().date();
this.currentDay = moment().day();
this.today();
}
constructor() {}

ngOnChanges() {
this.createMonth(this.displayYear, this.displayMonth);
Expand Down

0 comments on commit 5b1e69e

Please sign in to comment.