npm install ngx-calender --save
import { NgxCalenderModule } from 'ngxCalender';
// other imports
@NgModule({
imports: [
// other imports
NgxCalenderModule
],
// ...
})
export class AppModule {}
<ng-calender (clickedDate)="clickHandler()" ></ng-calender>
Where
clickHandler: clicked handler on date and it return the clicked date as Date like:
eg: Wed Dec 18 2020 00:00:00 GMT+0200 (Central European Summer Time)
Access it like:
@ViewChild('calender') private calender: NgxCalenderComponent;
// then you can access some public variables:
currentDate: string;
currentMonth: string;
currentYear: number;
eg:
ngAfterViewInit() {
console.log(this.calender.currentDate, this.calender.currentMonth, this.calender.currentYear);
}
unit test coming soon.
coming soon.
pull request always welcome!!!
- Able to move previous/next month
- Able to move previous/next year
- Able to return current week details
- ...