I am trying to push one array object into another in typescript. Here is what i have:
days: DayDto[];
while (startsOn.toDate() < endsOn.toDate())
{
var newDate = startsOn.add(1, 'days');
startsOn = moment(newDate);
let d = this.getDayOfWeek(newDate.isoWeekday()) + newDate.date().toString();
let w = this.getDayOfWeek(newDate.isoWeekday()) == "Sa" ? true : this.getDayOfWeek(newDate.isoWeekday()) == "Su" ? true : false;
this.temp = new DayDto;
this.temp.dayOfMonth = d;
this.temp.weekEnd = w;
this.temp.payPeriodEnd = "S31";
//this.days.push(
// [
// new DayDto( d, w, "S31")
// ]
//);
}
So, I have a loop that while startsOn is less than endsOn, it loops through and gets the day of the week (Su) and the day of the month (21) and puts those into d and w. then those are put into the this.days array at the end of each loop. But i cannot get the logic correct for adding them to the array.