Skip to content

ritsrivastava01/ngxCalender

Repository files navigation

Angular based plug and play calender component

npm version GitHub pull requests GitHub stars GitHub License

Screenshot

Installation

npm install ngx-calender --save

Usage

Import the calendar Module

 import { NgxCalenderModule } from 'ngxCalender';
  // other imports 
  
  @NgModule({
    imports: [
      // other imports 
      NgxCalenderModule
    ],
    // ...
  })
  export class AppModule {}

Add selector in template file my-component.html

  <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 the variable from calender component


  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.

Running end-to-end tests

coming soon.

Further help

pull request always welcome!!!

Future Plan

  • Able to move previous/next month
  • Able to move previous/next year
  • Able to return current week details
  • ...

About

Simple Angular based plug n play calender component

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published