I am currently utilizing the Angular-2-datepicker in my project. Everything seems to be functioning properly, but whenever I attempt to set the [(date)] attribute, an error is thrown.
An error stating that date.getMonth is not a function keeps popping up.
After doing some research, it appears that this issue may arise because my variable is not of type date. However, upon checking, mine actually is. As a result, I have hit a roadblock and cannot seem to find a solution.
This is how my HTML looks:
...
<material-datepicker dateFormat="DD-MM-YYYY" weekStart="1" [(date)]="definitionDetails.From"></material-datepicker>
...
This is my Model structure:
export class ClosingDayDefinition implements Serializable<ClosingDayDefinition> {
ID: number;
DescriptionID: number;
Info: models.DefinitionDetailInfo;
Description: models.DefinitionDescription;
CodeId: number;
From: Date;
To: Date;
Recurring: boolean;
Holiday: boolean;
Groups: Array<models.ClosingDayGroup>;
TypeName: string;
Here's how my Component is defined:
...
public definitionDetails: models.ClosingDayDefinition;
...
Furthermore, here's what was recorded in the Var Log: