swapnilnakate7 / sn-calendar

Angular7 Calendar Module

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SnCalendar

Lint,Test,Build

This project uses Moment.js for calendar functionality. You can import the SnCalendarModule and use SnCalendarComponent straight away. Please feel free to report any bugs and I'll be happy to introduce any feature requests. For Demo: Stable | Latest

Using into your Angular Application

  • run npm i sn-calendar into your project root directory.
  • import SnCalendarModule into your application.
  • use <sn-calendar> element.
  • supports locale, date(Moment Object) as input.
  • use selectedDateOut event to get the selected date.
  • supports restrictPast to disable past dates, if not provided calendar will show previous dates as well.

Usage

Importing SnCalendarModule into app.module.ts

import { SnCalendarModule } from 'sn-calendar';

@NgModule({
 declarations: [
   AppComponent
 ],
 imports: [
   BrowserModule,
   AppRoutingModule,
   SnCalendarModule
 ],
 providers: [],
 bootstrap: [AppComponent]
})
export class AppModule { }

Using sn-calendar component with options in HTML

<sn-calendar 
[selectedDate]="date"
[locale]="locale"
[startDayofWeek]="'sunday'"
[enableDateRange]="true"
[restrictPast]="restrictPast"
(dateSelected)="getUpdatedDate($event)"
(dateRangeSelected)="showDateRange($event)" ></sn-calendar>
Attribute Supported Type
selectedDate Moment
locale string
startDayofWeek string
enableDateRange boolean
restrictPast boolean
dateSelected EventEmitter with Moment
dateRangeSelected EventEmitter with {start:Moment,end:Moment}

Help

get in touch with me email: nakate.swapnil7@gmail.com | twitter: @SwapnilNakate7

About

Angular7 Calendar Module


Languages

Language:TypeScript 69.1%Language:JavaScript 12.2%Language:HTML 10.5%Language:SCSS 8.2%