Calendar overview

Overview
API
Theme
Examples

NbCalendarComponent

Calendar component provides a capability to choose a date.

<nb-calendar [(date)]="date"></nb-calendar>
<nb-calendar [date]="date" (dateChange)="handleDateChange($event)"></nb-calendar>

Basic usage example

Showcase

Installation

Import NbCalendarModule to your feature module.

@NgModule({
  imports: [
    // ...
    NbCalendarModule,
  ],
})
export class PageModule { }

Usage

If you want to select ranges you can use NbCalendarRangeComponent.

<nb-calendar-range [(range)]="range"></nb-calendar-range>
<nb-calendar-range [range]="range" (rangeChange)="handleRangeChange($event)"></nb-calendar-range>

In order to use it, you have to import NbCalendarRangeModule.

Range

The calendar component is supplied with a calendar navigation that contains navigate buttons. If you do not want to use it you can hide calendar navigation using showNavigation property.

Without navigation

As you can see in the basic usage example calendar contains previous and next month days which can be disabled using boundingMonth property.

Bounding months

You can define starting view of the calendar by setting startView property. Available values: year, month and date.

Start view

You can use a larger version of the calendar by defining size property. Available values: medium(which is default) and large.

Size

Calendar supports min and max dates which disables values out of min-max range.

Borders

Also, you can define custom filter property that should be predicate which receives date and returns false if this date has to be disabled. In this example, we provide the filter which disables weekdays.

Filter

Week numbers column could be enabled via showWeekNumber binding:

Week number

If you need create custom cells you can easily provide custom components for calendar. For examples if you want to show any average price under each date you can just provide custom dayCellComponent. Custom cells for month and year can be provided the same way, check API reference.

Custom day cell
Chat UI
Previous page
Calendar Range
Next page

Need some help or found an issue?

Ask on Stack Overflow with tag `nebular` or post an issue on GitHub.