Calendar for Angular and Ionic 2/3/4

Learn more

Date & time picker component featuring calendar month view, week view, date scroller and time picker.

Use it as angular components or directives that you can use on existing components. Compatible with mobiscroll forms, custom inputs, ion-inputs & more

Shipping with useful features for a refined UX, including:

  • Usage on mobile and desktop with responsive features
  • Single and multiple select
  • Week select
  • Date & time select
  • Validation with disabled dates, min & max for restricting selection
  • Marked days
  • Week counter
  • Multiple month view
  • Fullscreen view
  • Modal, popup and inline display support
  • RTL Support
  • Full localization


Interested in date and/or time selection? Other demos that could be useful:

Date & Time Range Event Calendar


Calendar demos available for other frameworks.

Viewing demos & code for

light
dark

Change the theme setting here

Calendar - Mobile & Desktop usage

Change demo
Mobile & Desktop usage

Use the calendar view for both mobile and desktop or set it up responsively. The main difference between the two rendering modes - controlled by the touchUi setting - is how the calendar is laid out. When set to false the component shows up suitable for larger screens and pointer interaction while setting it to true renders it suitable for touch screens.

Handle different screen sizes by setting it up responsively  Check out the responsive demo →
import { Component } from '@angular/core';
import { mobiscroll, MbscCalendarOptions } from '@mobiscroll/angular';

mobiscroll.settings = {
    lang: '',
    theme: ''
};

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})
export class AppComponent {
    mobile: Date;
    desktop: Date;

    mobileSettings: MbscCalendarOptions = {
        display: 'bubble'
    };

    desktopSettings: MbscCalendarOptions = {
        display: 'bubble',
        touchUi: false
    };
}
<mbsc-form>
    <div class="mbsc-grid mbsc-form-grid">
        <div class="mbsc-row">
            <div class="mbsc-col-sm-12 mbsc-col-md-6">
                <mbsc-calendar [(ngModel)]="mobile" [options]="mobileSettings" placeholder="Please Select..." input-style="box">Mobile</mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-6">
                <mbsc-calendar [(ngModel)]="desktop" [options]="desktopSettings" placeholder="Please Select..." input-style="box">Desktop</mbsc-calendar>
            </div>
        </div>
    </div>
</mbsc-form>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MbscModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    HttpClientJsonpModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Calendar - App & Website usage

Change demo
App & Website usage

Use it on any custom input or with Mobiscroll form fields. The calendar is shown on input focus, but it can also be triggered on a button click or it can be embedded directly into the page.

Let’s say you already have a form and you want to enhance date selection. You can use it on existing fields or new fields.

import { Component } from '@angular/core';
import { mobiscroll, MbscCalendarOptions } from '@mobiscroll/angular';

mobiscroll.settings = {
    lang: '',
    theme: '',
    display: 'bubble'
};

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})
export class AppComponent {
    date: Date;
    time: Date;
    nonForm: Date;
    external = new Date();

    dateTimeSettings: MbscCalendarOptions = {
        controls: ['calendar', 'time']
    };

    externalSettings: MbscCalendarOptions = {
        showOnTap: false,
        showOnFocus: false,
        controls: ['calendar', 'time']
    };
}
<mbsc-form input-style="box">
    <div class="mbsc-grid mbsc-form-grid">
        <mbsc-form-group>
            <mbsc-form-group-title>Using the Calendar with Mobiscroll form fields</mbsc-form-group-title>
            <div class="mbsc-row">
                <div class="mbsc-col-sm-12 mbsc-col-md-6">
                    <mbsc-calendar [(ngModel)]="date" placeholder="Please Select...">Date</mbsc-calendar>
                </div>
                <div class="mbsc-col-sm-12 mbsc-col-md-6">
                    <mbsc-calendar [(ngModel)]="dateTime" [options]="dateTimeSettings" placeholder="Please Select...">Data & Time</mbsc-calendar>
                </div>
            </div>
        </mbsc-form-group>
    </div>
</mbsc-form>
<div class="mbsc-grid">
    <div class="mbsc-row">
        <div class="mbsc-col-sm-12 mbsc-col-md-6">
            <label for="demo-app-date-non-form">Date</label>
            <input id="demo-app-date-non-form" [(ngModel)]="nonForm" mbsc-calendar class="demo-non-form" placeholder="Please Select..." />
        </div>
        <div class="mbsc-col-sm-12 mbsc-col-md-6">
            <div class="mbsc-row mbsc-align-items-end">
                <div class="mbsc-col-9">
                    <label for="demo-app-date-external">Show on button click only</label>
                    <input id="demo-app-date-external" [(ngModel)]="external" mbsc-calendar [mbsc-options]="externalSettings" #externalDate="mobiscroll" class="demo-non-form" />
                </div>
                <div class="mbsc-col-3 external-container">
                    <button (click)="externalDate.instance.show()" class="external-button">Show</button>
                </div>
            </div>
        </div>
    </div>
</div>
.demo-non-form {
    color: initial;
    width: 100%;
    padding: 10px;
    margin: 6px 0 12px 0;
    border: 1px solid #ccc;
    border-radius: 0;
    font-family: arial, verdana, sans-serif;
    font-size: 14px;
    box-sizing: border-box;
    -webkit-appearance: none;
}

.external-container button.external-button {
    font-weight: 400;
    padding: 10px;
    margin: 6px 0 13px 0;
    width: 100%;
}
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MbscModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    HttpClientJsonpModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Calendar - Date types

Change demo
Date types

The calendar works with multiple data types:

  • JS date objects - new Date(1995, 11, 17, 15, 24)
  • ISO date strings - '2008-09-15T15:53:00'
  • Localized date strings - '04/25/2010 8:15 AM'
  • Moment.js objects - moment([2018, 3, 27, 12, 15])
import { Component } from '@angular/core';
import { mobiscroll, MbscCalendarOptions } from '@mobiscroll/angular';
import moment from 'moment';

mobiscroll.settings = {
    theme: '',
    lang: ''
};

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})
export class AppComponent {
    date: Date;
    iso: string;
    locale: string;
    moment: Date;

    isoSettings: MbscCalendarOptions = {
        returnFormat: 'iso8601'
    };

    localeSettings: MbscCalendarOptions = {
        returnFormat: 'locale'
    };

    momentSettings: MbscCalendarOptions = {
        returnFormat: 'moment',
        // need this if moment is not accessible globally
        moment: moment
    };

    setDate() {
        this.date = new Date(1995, 11, 17, 15, 24);
    }

    setISO() {
        this.iso = '2008-09-15T15:53:00';
    }

    setLocale() {
        this.locale = '04/25/2010 8:15 AM';
    }

    setMoment() {
        // make sure that moment js is loaded
        this.moment = moment([2018, 3, 27, 12, 15]);
    }
}
<mbsc-form>
    <mbsc-form-group>
        <mbsc-form-group-title>Controlling the default value</mbsc-form-group-title>
        <div class="mbsc-btn-group-block">
            <mbsc-button (click)="setDate()" color="primary">Set: Sun Dec 17 1995 03:24:00 GMT</mbsc-button>
        </div>
        <div>
            <mbsc-calendar [(ngModel)]="date">Date object</mbsc-calendar>
        </div>
    </mbsc-form-group>
    <mbsc-form-group class="mbsc-padding">
        Return value: {{date}}
    </mbsc-form-group>
    <mbsc-form-group>
        <mbsc-form-group-title>Working with Date strings</mbsc-form-group-title>
        <div class="mbsc-btn-group-block">
            <mbsc-button (click)="setISO()" color="primary">Set: 2008-09-15T15:53:00</mbsc-button>
        </div>
        <div>
            <mbsc-calendar [(ngModel)]="iso" [options]="isoSettings">ISO string</mbsc-calendar>
        </div>
    </mbsc-form-group>
    <mbsc-form-group class="mbsc-padding">
        Return value: {{iso}}
    </mbsc-form-group>
    <mbsc-form-group>
        <mbsc-form-group-title>Working with Localized Strings</mbsc-form-group-title>
        <div class="mbsc-btn-group-block">
            <mbsc-button (click)="setLocale()" color="primary">Set: 04/25/2010 8:15 AM</mbsc-button>
        </div>
        <div>
            <mbsc-calendar [(ngModel)]="locale" [options]="localeSettings">Locale format</mbsc-calendar>
        </div>
    </mbsc-form-group>
    <mbsc-form-group class="mbsc-padding">
        Return value: {{locale}}
    </mbsc-form-group>
    <mbsc-form-group>
        <mbsc-form-group-title>Working with Moment JS Objects</mbsc-form-group-title>
        <div class="mbsc-btn-group-block">
            <mbsc-button (click)="setMoment()" color="primary">Set: 2018-04-27T12:15:00+03:00</mbsc-button>
        </div>
        <div>
            <mbsc-calendar [(ngModel)]="moment" [options]="momentSettings">Moment JS</mbsc-calendar>
        </div>
    </mbsc-form-group>
    <mbsc-form-group class="mbsc-padding">
        Return value: {{moment ? moment.format() : ''}}
    </mbsc-form-group>
</mbsc-form>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MbscModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    HttpClientJsonpModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Calendar - Mobile display modes

Change demo
Mobile display modes

Different display modes can be used for mobile and desktop. On mobile, the calendar can be rendered at the top or bottom of the screen, in the center of the screen, anchored to an input or any object for that matter and it can also be embedded in any inline content.

Interested in desktop usage?  Check out the next example →
import { Component } from '@angular/core';
import { mobiscroll, MbscCalendarOptions } from '@mobiscroll/angular';

mobiscroll.settings = {
    lang: '',
    theme: ''
};

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})
export class AppComponent {
    calendarBottom: Date;
    calendarTop: Date;
    calendarCenter: Date;
    calendarBubble: Date;
    calendarFullscreen: Date;
    calendarInline: Date;
    
    calendarBottomSettings: MbscCalendarOptions = {
        display: 'bottom'
    };
    
    calendarTopSettings: MbscCalendarOptions = {
        display: 'top'
    };
    
    calendarCenterSettings: MbscCalendarOptions = {
        display: 'center'
    };
    
    calendarBubbleSettings: MbscCalendarOptions = {
        display: 'bubble'
    };
    
    calendarFullscreenSettings: MbscCalendarOptions = {
        display: 'center',
        layout: 'liquid'
    };
    
    calendarInlineSettings: MbscCalendarOptions = {
        display: 'inline'
    };
}
<mbsc-form>
    <mbsc-form-group>
        <mbsc-form-group-title>Try different display modes</mbsc-form-group-title>
        <mbsc-calendar [(ngModel)]="calendarBottom" [options]="calendarBottomSettings" placeholder="Please select...">Bottom</mbsc-calendar>
        <mbsc-calendar [(ngModel)]="calendarTop" [options]="calendarTopSettings" placeholder="Please select...">Top</mbsc-calendar>
        <mbsc-calendar [(ngModel)]="calendarCenter" [options]="calendarCenterSettings" placeholder="Please select...">Center</mbsc-calendar>
        <mbsc-calendar [(ngModel)]="calendarBubble" [options]="calendarBubbleSettings" placeholder="Please select...">Bubble</mbsc-calendar>
        <mbsc-calendar [(ngModel)]="calendarFullscreen" [options]="calendarFullscreenSettings" placeholder="Please select...">Fullscreen</mbsc-calendar>
    </mbsc-form-group>
    <mbsc-form-group class="mbsc-padding">
        <p class="mbsc-thin">With inline display you can embed the Calendar component in almost any markup or form.</p>
    </mbsc-form-group>
    <mbsc-form-group>
        <mbsc-form-group-title>Embedded calendar</mbsc-form-group-title>
        <mbsc-calendar [(ngModel)]="calendarInline" [options]="calendarInlineSettings" type="hidden"></mbsc-calendar>
    </mbsc-form-group>
</mbsc-form>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MbscModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    HttpClientJsonpModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Calendar - Desktop display modes

Change demo
Desktop display modes

Use the available display modes on mobile and desktop. On larger screens you have slightly different rendering options suitable for the large form-factor and pointer interaction. Use the top, bottom and center modes for getting it in front of the users or stay in context and anchor it to the input.

Interested in mobile usage?  Check out the previous example →
import { Component } from '@angular/core';
import { mobiscroll, MbscCalendarOptions } from '@mobiscroll/angular';

mobiscroll.settings = {
    lang: '',
    theme: ''
};

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})
export class AppComponent {
    top: Date;
    bottom: Date;
    anchored: Date;
    center: Date;
    datetime: Date;
    date: Date;
    setBtn: Date;
    setCancel: Date;

    datetimeSettings: MbscCalendarOptions = {
        touchUi: false,
        controls: ['calendar', 'time']
    };

    dateSettings: MbscCalendarOptions = {
        touchUi: false,
        controls: ['calendar']
    };

    setBtnSettings: MbscCalendarOptions = {
        display: 'center',
        touchUi: false,
        buttons: ['set']
    };

    setCancelSettings: MbscCalendarOptions = {
        display: 'center',
        touchUi: false,
        buttons: ['set', 'cancel']
    };
}
<mbsc-form>
    <div class="mbsc-grid">
        <div class="mbsc-row mbsc-justify-content-center">
            <div class="mbsc-col-sm-9 mbsc-col-md-7 mbsc-col-xl-5">
                <mbsc-form-group inset>
                    <mbsc-form-group-title>Pop-up positioning</mbsc-form-group-title>
                    <mbsc-calendar [(ngModel)]="top" [touchUi]="false" display="top" placeholder="Please select...">Top</mbsc-calendar>
                    <mbsc-calendar [(ngModel)]="bottom" [touchUi]="false" display="bottom" placeholder="Please select...">Bottom</mbsc-calendar>
                    <mbsc-calendar [(ngModel)]="anchored" [touchUi]="false" placeholder="Please select...">Anchored</mbsc-calendar>
                    <mbsc-calendar [(ngModel)]="center" [touchUi]="false" display="center" placeholder="Please select...">Center</mbsc-calendar>
                </mbsc-form-group>
            </div>
        </div>
        <div class="mbsc-row mbsc-justify-content-center">
            <div class="mbsc-col-sm-9 mbsc-col-md-7 mbsc-col-xl-5">
                <mbsc-form-group inset>
                    <mbsc-form-group-title>Basic usage</mbsc-form-group-title>
                    <mbsc-calendar [(ngModel)]="datetime" [options]="datetimeSettings" placeholder="Please select...">Date & Time</mbsc-calendar>
                    <mbsc-calendar [(ngModel)]="date" [options]="dateSettings" placeholder="Please select...">Date</mbsc-calendar>
                </mbsc-form-group>
            </div>
        </div>
        <div class="mbsc-row mbsc-justify-content-center">
            <div class="mbsc-col-sm-9 mbsc-col-md-7 mbsc-col-xl-5">
                <mbsc-form-group inset>
                    <mbsc-form-group-title>With buttons</mbsc-form-group-title>
                    <mbsc-calendar [(ngModel)]="setBtn" [options]="setBtnSettings" placeholder="Please select...">Set button</mbsc-calendar>
                    <mbsc-calendar [(ngModel)]="setCancel" [options]="setCancelSettings" placeholder="Please select...">Set/Cancel</mbsc-calendar>
                </mbsc-form-group>
            </div>
        </div>
    </div>
</mbsc-form>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MbscModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    HttpClientJsonpModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Calendar - Responsive

Change demo
Responsive

Set up the Calendar to behave responsively. Use the appriopriate positioning and rendering based on the screen size. You can have a bottom positioned calendar on mobile, a popover anchored to the input on tablet and desktop display on large sceens.

All this can be configured under the responsive setting where you pass the options for each breakpoint.

responsive: {
    xsmall: { ... }, small: { ... }, medium: { ... }, large: { ... }, xlarge: { ... }
}

import { Component } from '@angular/core';
import { mobiscroll, MbscCalendarOptions } from '@mobiscroll/angular';

mobiscroll.settings = {
    lang: '',
    theme: ''
};

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})
export class AppComponent {
    date: Date;
    display: Date;

    dateSettings: MbscCalendarOptions = {
        responsive: {
            xsmall: {
                controls: ['date']
            },
            small: {
                controls: ['calendar'],
                display: 'bubble'
            },
            medium: {
                controls: ['calendar'],
                months: 2,
                yearChange: false,
                touchUi: false
            }
        }
    };
    displaySettings: MbscCalendarOptions = {
        responsive: {
            small: {
                controls: ['calendar'],
                display: 'center'
            },
            medium: {
                display: 'bubble',
                touchUi: false
            }
        }
    };
}
<mbsc-form>
    <div class="mbsc-grid">
        <div class="mbsc-row mbsc-justify-content-center">
            <div class="mbsc-col-sm-9 mbsc-col-md-7 mbsc-col-xl-5">
                <mbsc-form-group inset>
                    <mbsc-form-group-title>Basic usage</mbsc-form-group-title>
                    <mbsc-calendar [(ngModel)]="date" [options]="dateSettings" placeholder="Please Select...">Date</mbsc-calendar>
                    <mbsc-calendar [(ngModel)]="display" [options]="displaySettings" placeholder="Please Select...">Display</mbsc-calendar>
                </mbsc-form-group>
            </div>
        </div>
    </div>
</mbsc-form>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MbscModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    HttpClientJsonpModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Calendar - Date picker

Change demo
Date picker

Use the calendar view for date selection. Navigate it by clicking the arrows next to the year and month or by swiping. The dateFormat controls how the selected value looks. Check out some great examples for custom formats or if you are interested in a scroller UI, take a look at the date scroller.

Interested in a date & time picker?  Check out the calendar with time picker →
import { Component } from '@angular/core';
import { mobiscroll, MbscCalendarOptions } from '@mobiscroll/angular';

mobiscroll.settings = {
    lang: '',
    theme: '',
    display: 'bubble'
};

const now = new Date();

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})
export class AppComponent {
    mobile = now;
    desktop = now;
    header = now;
    nonForm = now;
    external = now;

    desktopSettings: MbscCalendarOptions = {
        touchUi: false
    };

    headerSettings: MbscCalendarOptions = {
        headerText: '{value}'
    };

    externalSettings: MbscCalendarOptions = {
        showOnTap: false,
        showOnFocus: false
    };
}
<mbsc-form input-style="box" label-style="stacked">
    <div class="mbsc-grid mbsc-form-grid">
        <div class="mbsc-row">
            <div class="mbsc-col-sm-12 mbsc-col-md-4">
                <mbsc-calendar [(ngModel)]="mobile">Mobile</mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4">
                <mbsc-calendar [(ngModel)]="desktop" [options]="desktopSettings">Desktop</mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4">
                <mbsc-calendar [(ngModel)]="header" [options]="headerSettings">Header text</mbsc-calendar>
            </div>
        </div>
    </div>
</mbsc-form>
<div class="mbsc-grid">
    <div class="mbsc-row">
        <div class="mbsc-col-sm-12 mbsc-col-md-6">
            <label for="demo-app-date-non-form">Date</label>
            <input id="demo-app-date-non-form" [(ngModel)]="nonForm" mbsc-calendar class="demo-non-form" />
        </div>
        <div class="mbsc-col-sm-12 mbsc-col-md-6">
            <div class="mbsc-row mbsc-align-items-end">
                <div class="mbsc-col-9">
                    <label for="demo-app-date-external">Show on button click only</label>
                    <input id="demo-app-date-external" [(ngModel)]="external" mbsc-calendar [mbsc-options]="externalSettings" #externalDate="mobiscroll" class="demo-non-form" />
                </div>
                <div class="mbsc-col-3 external-container">
                    <button (click)="externalDate.instance.show()" class="external-button">Show</button>
                </div>
            </div>
        </div>
    </div>
</div>
.demo-non-form {
    color: initial;
    width: 100%;
    padding: 10px;
    margin: 6px 0 12px 0;
    border: 1px solid #ccc;
    border-radius: 0;
    font-family: arial, verdana, sans-serif;
    font-size: 14px;
    box-sizing: border-box;
    -webkit-appearance: none;
}

.external-container button.external-button {
    font-weight: 400;
    padding: 10px;
    margin: 6px 0 13px 0;
    width: 100%;
}
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MbscModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    HttpClientJsonpModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Calendar - Date & Time picker

Change demo
Date & Time picker

Besides date-only functionality you can use the component as a combined date and time picker. Select the date from a calendar view and the time woth an hour and minute picker.

Show the date and time in localized formats or customize it to your needs. Take a look at some of the formatting options available.

Interested in a scroller component?  Check out the date & time scroller →
import { Component } from '@angular/core';
import { mobiscroll, MbscCalendarOptions } from '@mobiscroll/angular';

mobiscroll.settings = {
    lang: '',
    theme: '',
    display: 'bubble'
};

const now = new Date();

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})
export class AppComponent {
    mobile = now;
    desktop = now;
    header = now;
    nonForm = now;
    external = now;

    mobileSettings: MbscCalendarOptions = {
        controls: ['calendar', 'time'],
        touchUi: false
    };

    desktopSettings: MbscCalendarOptions = {
        controls: ['calendar', 'time'],
        touchUi: false
    };

    headerSettings: MbscCalendarOptions = {
        controls: ['calendar', 'time'],
        headerText: '{value}'
    };

    nonFormSettings: MbscCalendarOptions = {
        controls: ['calendar', 'time'],
        touchUi: false
    };

    externalSettings: MbscCalendarOptions = {
        controls: ['calendar', 'time'],
        showOnTap: false,
        showOnFocus: false
    };
}
<mbsc-form input-style="box" label-style="stacked">
    <div class="mbsc-grid mbsc-form-grid">
        <div class="mbsc-row">
            <div class="mbsc-col-sm-12 mbsc-col-md-4">
                <mbsc-calendar [(ngModel)]="mobile" [options]="mobileSettings">Mobile</mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4">
                <mbsc-calendar [(ngModel)]="desktop" [options]="desktopSettings">Desktop</mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4">
                <mbsc-calendar [(ngModel)]="header" [options]="headerSettings">Header text</mbsc-calendar>
            </div>
        </div>
    </div>
</mbsc-form>
<div class="mbsc-grid">
    <div class="mbsc-row">
        <div class="mbsc-col-sm-12 mbsc-col-md-6">
            <label for="demo-app-date-non-form">Date</label>
            <input id="demo-app-date-non-form" [(ngModel)]="nonForm" mbsc-calendar [mbsc-options]="nonFormSettings" class="demo-non-form" />
        </div>
        <div class="mbsc-col-sm-12 mbsc-col-md-6">
            <div class="mbsc-row mbsc-align-items-end">
                <div class="mbsc-col-9">
                    <label for="demo-app-date-external">Show on button click only</label>
                    <input id="demo-app-date-external" [(ngModel)]="external" mbsc-calendar [mbsc-options]="externalSettings" #externalDate="mobiscroll" class="demo-non-form" />
                </div>
                <div class="mbsc-col-3 external-container">
                    <button (click)="externalDate.instance.show()" class="external-button">Show</button>
                </div>
            </div>
        </div>
    </div>
</div>
.demo-non-form {
    color: initial;
    width: 100%;
    padding: 10px;
    margin: 6px 0 12px 0;
    border: 1px solid #ccc;
    border-radius: 0;
    font-family: arial, verdana, sans-serif;
    font-size: 14px;
    box-sizing: border-box;
    -webkit-appearance: none;
}

.external-container button.external-button {
    font-weight: 400;
    padding: 10px;
    margin: 6px 0 13px 0;
    width: 100%;
}
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MbscModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    HttpClientJsonpModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Calendar - Multiple day selection

Change demo
Multiple day selection

You can pick between single and mutiple day selection. Multi-date select is useful when users need to pick from a set of dates that are not necessarily in a range. Passing select: 'multiple' or a number, like select: 5 enables multiple day selection.

The latter also sets a maximum selectable, so passing select: 5 means a maximum number of five dates can be selected.

Interested in date range selection?  Check out the range picker →
import { Component } from '@angular/core';
import { mobiscroll, MbscCalendarOptions } from '@mobiscroll/angular';

mobiscroll.settings = {
    lang: '',
    theme: ''
};

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})

export class AppComponent {
    multi: Date;
    max: Date;
    counter: Date;

    multiSettings: MbscCalendarOptions = {
        display: 'inline',
        select: 'multiple'
    };

    maxSettings: MbscCalendarOptions = {
        display: 'inline',
        select: 5,
        headerText: 'Pick up to 5 days'
    };

    counterSettings: MbscCalendarOptions = {
        display: 'inline',
        select: 'multiple',
        counter: true
    };
}
<mbsc-form>
    <div class="mbsc-grid">
        <div class="mbsc-row">
            <div class="mbsc-col-sm-12 mbsc-col-md-4">
                <mbsc-form-group>
                    <mbsc-form-group-title>Multi-day</mbsc-form-group-title>
                    <mbsc-calendar [(ngModel)]="multi" [options]="multiSettings"></mbsc-calendar>
                </mbsc-form-group>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4">
                <mbsc-form-group>
                    <mbsc-form-group-title>Max days</mbsc-form-group-title>
                    <mbsc-calendar [(ngModel)]="max" [options]="maxSettings"></mbsc-calendar>
                </mbsc-form-group>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4">
                <mbsc-form-group>
                    <mbsc-form-group-title>Counter</mbsc-form-group-title>
                    <mbsc-calendar [(ngModel)]="counter" [options]="counterSettings"></mbsc-calendar>
                </mbsc-form-group>
            </div>
        </div>
    </div>
</mbsc-form>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MbscModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    HttpClientJsonpModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Calendar - Week selection

Change demo
Week selection

You can select entire weeks instead of single days. This is useful when users need to select a full week instead of a variable range. It can be activated with selectType: 'week'. Single or multiple weeks can be selected based on the select: 'single','multiple' or integer setting. You can also control the day the week starts with the firstDay setting.

Interested in a variable date range selection?  Check out the range picker →
import { Component } from '@angular/core';
import { mobiscroll, MbscCalendarOptions } from '@mobiscroll/angular';

mobiscroll.settings = {
    lang: '',
    theme: ''
};

const fromMonday = [],
    fromSaturday = [],
    twoWeeks = [];

for (let i; i < 7; i++) {
    fromMonday.push(new Date(2018, 0, 8 + i));
    fromSaturday.push(new Date(2018, 0, 6 + i));
}

for (let j; j < 14; j++) {
    twoWeeks.push(new Date(2018, 0, 8 + j));
}

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})

export class AppComponent {
    mon = fromMonday;
    sat = fromSaturday;
    multi = twoWeeks;

    monSettings: MbscCalendarOptions = {
        display: 'inline',
        selectType: 'week',
        firstSelectDay: 1,
        firstDay: 1
    };

    satSettings: MbscCalendarOptions = {
        display: 'inline',
        selectType: 'week',
        firstSelectDay: 6,
        firstDay: 1
    };

    multiSettings: MbscCalendarOptions = {
        display: 'inline',
        selectType: 'week',
        firstSelectDay: 1,
        firstDay: 1,
        select: 'multiple'
    };
}
<mbsc-form>
    <div class="mbsc-grid">
        <div class="mbsc-row">
            <div class="mbsc-col-sm-12 mbsc-col-md-4">
                <mbsc-form-group>
                    <mbsc-form-group-title>Mon-Sun</mbsc-form-group-title>
                    <mbsc-calendar [(ngModel)]="mon" [options]="monSettings"></mbsc-calendar>
                </mbsc-form-group>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4">
                <mbsc-form-group>
                    <mbsc-form-group-title>Sat-Fri</mbsc-form-group-title>
                    <mbsc-calendar [(ngModel)]="sat" [options]="satSettings"></mbsc-calendar>
                </mbsc-form-group>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4">
                <mbsc-form-group>
                    <mbsc-form-group-title>Multiple</mbsc-form-group-title>
                    <mbsc-calendar [(ngModel)]="multi" [options]="multiSettings"></mbsc-calendar>
                </mbsc-form-group>
            </div>
        </div>
    </div>
</mbsc-form>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MbscModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    HttpClientJsonpModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Calendar - Variable week view

Change demo
Variable week view

The calendar view supports variable weeks. Save space by only displaying one or two weeks or go for a full month where it makes sense. Use the weeks setting that expects a number of rows. The default is six weeks, but feel free to play around.

Looking to dynamically switch views?  Check out the week to month view example →
import { Component } from '@angular/core';
import { mobiscroll } from '@mobiscroll/angular';

mobiscroll.settings = {
    lang: '',
    theme: ''
};

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})
export class AppComponent {
    calendarOneWeek: Date;
    calendarTwoWeek: Date;
    calendarThreeWeek: Date;
}
<mbsc-form>
    <mbsc-form-group>
        <mbsc-form-group-title>One week view</mbsc-form-group-title>
        <mbsc-calendar [(ngModel)]="calendarOneWeek" display="inline" weeks="1"></mbsc-calendar>
    </mbsc-form-group>
    <mbsc-form-group>
        <mbsc-form-group-title>Two week view</mbsc-form-group-title>
        <mbsc-calendar [(ngModel)]="calendarTwoWeek" display="inline" weeks="2"></mbsc-calendar>
    </mbsc-form-group>
    <mbsc-form-group>
        <mbsc-form-group-title>Three week view</mbsc-form-group-title>
        <mbsc-calendar [(ngModel)]="calendarTreeWeek" display="inline" weeks="3"></mbsc-calendar>
    </mbsc-form-group>
</mbsc-form>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MbscModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    HttpClientJsonpModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Calendar - Week to month view

Change demo
Week to month view

While the calendar supports variable week views there are cases when you don't want to commit to a single setup. Get the best of both worlds by dynamically letting the users switch between a week-view and a full month-view. Use the compact week-view to save space and programatically switch to a month-view when users need the full context of a month.

import { Component } from '@angular/core';
import { mobiscroll, MbscCalendarOptions } from '@mobiscroll/angular';

mobiscroll.settings = {
    lang: '',
    theme: ''
};

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})
export class AppComponent {
    demo: Date;
    weekNr = 6;

    settings: MbscCalendarOptions = {
        display: 'inline'
    };
}
<mbsc-form>
    <mbsc-form-group>
        <mbsc-form-group-title>Month view and week view</mbsc-form-group-title>
        <mbsc-segmented-group [(ngModel)]="weekNr">
            <mbsc-segmented value="6">Month</mbsc-segmented>
            <mbsc-segmented value="1">Week</mbsc-segmented>
        </mbsc-segmented-group>
        <mbsc-calendar [(ngModel)]="demo" [options]="settings" [weeks]="weekNr"></mbsc-calendar>
    </mbsc-form-group>
</mbsc-form>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MbscModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    HttpClientJsonpModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Calendar - Multi month view

Change demo
Multi month view
Angular Multi-month calendar. Show one, two or three months side by side depending on screen size. Fixed or dynamic months. For Angular 2/4/5/6/7/8 and Ionic 2/3/4.
import { Component } from '@angular/core';
import { mobiscroll, MbscCalendarOptions } from '@mobiscroll/angular';

mobiscroll.settings = {
    lang: '',
    theme: ''
};

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})
export class AppComponent {
    twoBubbleCal: Date;
    threeBubbleCal: Date;
    fourBubbleCal: Date;
    bubbleCal: Date;
    twoCal: Date;
    threeCal: Date;
    fourCal: Date;
    cal: Date;

    twoBubbleCalSettings: MbscCalendarOptions = {
        display: 'bubble',
        months: 2,
        yearChange: false
    };

    threeBubbleCalSettings: MbscCalendarOptions = {
        display: 'bubble',
        months: 3,
        yearChange: false
    };

    fourBubbleCalSettings: MbscCalendarOptions = {
        display: 'bubble',
        months: 4,
        yearChange: false
    };

    bubbleCalSettings: MbscCalendarOptions = {
        display: 'bubble',
        months: 'auto'
    };

    twoCalSettings: MbscCalendarOptions = {
        display: 'center',
        months: 2,
        yearChange: false
    };

    threeCalSettings: MbscCalendarOptions = {
        display: 'center',
        months: 3,
        yearChange: false
    };

    fourCalSettings: MbscCalendarOptions = {
        display: 'center',
        months: 4,
        yearChange: false
    };

    calSettings: MbscCalendarOptions = {
        display: 'center',
        months: 'auto',
        yearChange: false
    };
}
<mbsc-form input-style="box" label-style="inline">
    <div class="mbsc-grid">
        <mbsc-form-group>
            <mbsc-form-group-title>Popover calendar</mbsc-form-group-title>
            <div class="mbsc-row mbsc-form-grid">
                <div class="mbsc-col-sm-12 mbsc-col-md-6 mbsc-col-xl-3">
                    <mbsc-calendar [(ngModel)]="twoBubbleCal" [options]="twoBubbleCalSettings" placeholder="Please select...">Two months</mbsc-calendar>
                </div>
                <div class="mbsc-col-sm-12 mbsc-col-md-6 mbsc-col-xl-3">
                    <mbsc-calendar [(ngModel)]="threeBubbleCal" [options]="threeBubbleCalSettings" placeholder="Please select...">Three months</mbsc-calendar>
                </div>
                <div class="mbsc-col-sm-12 mbsc-col-md-6 mbsc-col-xl-3">
                    <mbsc-calendar [(ngModel)]="fourBubbleCal" [options]="fourBubbleCalSettings" placeholder="Please select...">Four months</mbsc-calendar>
                </div>
                <div class="mbsc-col-sm-12 mbsc-col-md-6 mbsc-col-xl-3">
                    <mbsc-calendar [(ngModel)]="bubbleCal" [options]="bubbleCalSettings" placeholder="Please select...">Auto</mbsc-calendar>
                </div>
            </div>
        </mbsc-form-group>
        <mbsc-form-group>
            <mbsc-form-group-title>Center positioned calendar</mbsc-form-group-title>
            <div class="mbsc-row mbsc-form-grid">
                <div class="mbsc-col-sm-12 mbsc-col-md-6 mbsc-col-xl-3">
                    <mbsc-calendar [(ngModel)]="twoCal" [options]="twoCalSettings" placeholder="Please select...">Two months</mbsc-calendar>
                </div>
                <div class="mbsc-col-sm-12 mbsc-col-md-6 mbsc-col-xl-3">
                    <mbsc-calendar [(ngModel)]="threeCal" [options]="threeCalSettings" placeholder="Please select...">Three months</mbsc-calendar>
                </div>
                <div class="mbsc-col-sm-12 mbsc-col-md-6 mbsc-col-xl-3">
                    <mbsc-calendar [(ngModel)]="fourCal" [options]="fourCalSettings" placeholder="Please select...">Four months</mbsc-calendar>
                </div>
                <div class="mbsc-col-sm-12 mbsc-col-md-6 mbsc-col-xl-3">
                    <mbsc-calendar [(ngModel)]="cal" [options]="calSettings" placeholder="Please select...">Auto</mbsc-calendar>
                </div>
            </div>
        </mbsc-form-group>
    </div>
</mbsc-form>
.md-multi-month .md-desc p {
    margin: 0;
}
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MbscModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    HttpClientJsonpModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Calendar - Min & max values

Change demo
Min & max values

Use the min and max settings to restrict selection. This is useful to make picking a date faster and to reduce user errors. A great example is scheduling. You want to disable past dates and maybe enable selection from the next six months. Simply restrict values with the min and max.

Looking for cherry picking and disabling dates?  See how to set invalids →
import { Component } from '@angular/core';
import { mobiscroll, MbscCalendarOptions } from '@mobiscroll/angular';
import moment from 'moment';

mobiscroll.settings = {
    lang: '',
    theme: '',
    display: 'bubble'
};

const now = new Date(),
    yesterday = new Date(new Date().setDate(new Date().getDate() - 1)),
    tomorrow = new Date(new Date().setDate(new Date().getDate() + 1)),
    nextMonths = new Date(now.getFullYear(), now.getMonth() + 6, now.getDate());

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})
export class AppComponent {
    six = now;
    future = now;
    past = now;
    time = now;
    dateStr = now;
    moment = now;

    sixSettings: MbscCalendarOptions = {
        headerText: 'Select your next visit',
        max: nextMonths,
        min: tomorrow
    };

    futureSettings: MbscCalendarOptions = {
        min: tomorrow
    };

    pastSettings: MbscCalendarOptions = {
        max: yesterday
    };

    timeSettings: MbscCalendarOptions = {
        controls: ['calendar', 'time'],
        invalid: [
            { start: '00:00', end: '08:59' },
            { start: '17:01', end: '23:59' }
        ]
    };

    dateStrSettings: MbscCalendarOptions = {
        max: '2018-08-31T00:00',
        min: '08/01/2018'
    };

    momentSettings: MbscCalendarOptions = {
        max: moment([2018, 8, 30]),
        min: moment([2018, 8, 1])
    };
}
<mbsc-form input-style="box" label-style="stacked">
    <div class="mbsc-grid">
        <mbsc-form-group>
            <mbsc-form-group-title>Pick a date</mbsc-form-group-title>
            <div class="mbsc-row mbsc-form-grid">
                <div class="mbsc-col-sm-12 mbsc-col-md-6 mbsc-col-xl-3">
                    <mbsc-calendar [(ngModel)]="six" [options]="sixSettings">Next 6 months</mbsc-calendar>
                </div>
                <div class="mbsc-col-sm-12 mbsc-col-md-6 mbsc-col-xl-3">
                    <mbsc-calendar [(ngModel)]="future" [options]="futureSettings">Future dates</mbsc-calendar>
                </div>
                <div class="mbsc-col-sm-12 mbsc-col-md-6 mbsc-col-xl-3">
                    <mbsc-calendar [(ngModel)]="past" [options]="pastSettings">Past dates</mbsc-calendar>
                </div>
                <div class="mbsc-col-sm-12 mbsc-col-md-6 mbsc-col-xl-3">
                    <mbsc-calendar [(ngModel)]="time" [options]="timeSettings">With time</mbsc-calendar>
                </div>
            </div>
        </mbsc-form-group>
        <mbsc-form-group>
            <mbsc-form-group-title>Date formats</mbsc-form-group-title>
            <div class="mbsc-row mbsc-form-grid">
                <div class="mbsc-col-sm-12 mbsc-col-md-6">
                    <mbsc-calendar [(ngModel)]="dateStr" [options]="dateStrSettings">String</mbsc-calendar>
                </div>
                <div class="mbsc-col-sm-12 mbsc-col-md-6">
                    <mbsc-calendar [(ngModel)]="moment" [options]="momentSettings">Moment JS</mbsc-calendar>
                </div>
            </div>
        </mbsc-form-group>
    </div>
</mbsc-form>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MbscModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    HttpClientJsonpModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Calendar - Setting invalids

Change demo
Setting invalids

Disable dates with the invalid setting. It supports exact dates, ranges, recurring dates and weekdays. Time can also be invalidated by passing exact values and ranges.

Using invalids is essential to a great UX. First make sure you have the min & max values right and then work your way back to invalids. If you would like to re-enable dates inside an invalid range, you can do it with the valid setting. Having it set up correctly not just enhances the UX, but improves performance.

import { Component } from '@angular/core';
import { mobiscroll, MbscCalendarOptions } from '@mobiscroll/angular';
import moment from 'moment';

mobiscroll.settings = {
    lang: '',
    theme: '',
    display: 'inline'
};

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})
export class AppComponent {
    demo: Date;
    rec: Date;
    week: Date;
    range: Date;
    val: Date;
    dateStr: string;
    moment: object;

    demoSettings: MbscCalendarOptions = {
        invalid: [
            new Date(2018, 1, 5),
            new Date(2018, 1, 13),
            new Date(2018, 1, 18),
            new Date(2018, 1, 23)
        ],
        defaultValue: new Date(2018, 1, 14),
        weeks: 1
    };
    recSettings: MbscCalendarOptions = {
        invalid: [
            '12/24',
            '12/25',
            '12/26',
            '12/31'
        ],
        defaultValue: new Date(2018, 11, 10),
        weeks: 1
    };
    weekSettings: MbscCalendarOptions = {
        invalid: ['w0', 'w6'],
        weeks: 1
    };
    rangeSettings: MbscCalendarOptions = {
        invalid: [
            { start: new Date(2018, 11, 21), end: new Date(2018, 11, 31) }
        ],
        defaultValue: new Date(2018, 11, 10),
        weeks: 1
    };
    valSettings: MbscCalendarOptions = {
        invalid: [
            { start: new Date(2018, 11, 21), end: new Date(2018, 11, 31) }
        ],
        valid: [
            { start: new Date(2018, 11, 26), end: new Date(2018, 11, 30) }
        ],
        defaultValue: new Date(2018, 11, 27),
        weeks: 1
    };
    dateStrSettings: MbscCalendarOptions = {
        defaultValue: '2018-07-25T00:00',
        invalid: [
            '2018-07-10T00:00',
            '2018-07-16T00:00',
            '07/19/2018',
            '07/27/2018'
        ],
        weeks: 1
    };
    // make sure that moment js is loaded
    momentSettings: MbscCalendarOptions = {
        defaultValue: moment([2018, 8, 17]),
        invalid: [
            moment([2018, 8, 11]),
            moment([2018, 8, 20])
        ],
        weeks: 1
    };
}
<mbsc-form>
    <mbsc-form-group>
        <mbsc-form-group-title>Invalidating exact dates</mbsc-form-group-title>
        <mbsc-calendar [(ngModel)]="demo" [options]="demoSettings" display="inline"></mbsc-calendar>
    </mbsc-form-group>
    <mbsc-form-group>
        <mbsc-form-group-title>Invalidating recurring dates</mbsc-form-group-title>
        <mbsc-calendar [(ngModel)]="rec" [options]="recSettings" display="inline"></mbsc-calendar>
    </mbsc-form-group>
    <mbsc-form-group>
        <mbsc-form-group-title>Invalidating Weekdays</mbsc-form-group-title>
        <mbsc-calendar [(ngModel)]="week" [options]="weekSettings" display="inline"></mbsc-calendar>
    </mbsc-form-group>
    <mbsc-form-group>
        <mbsc-form-group-title>Invalidating date ranges</mbsc-form-group-title>
        <mbsc-calendar [(ngModel)]="range" [options]="rangeSettings" display="inline"></mbsc-calendar>
    </mbsc-form-group>
    <mbsc-form-group>
        <mbsc-form-group-title>Overriding inside invalid ranges</mbsc-form-group-title>
        <mbsc-calendar [(ngModel)]="val" [options]="valSettings" display="inline"></mbsc-calendar>
    </mbsc-form-group>
    <mbsc-form-group>
        <mbsc-form-group-title>String</mbsc-form-group-title>
        <mbsc-calendar [(ngModel)]="dateStr" [options]="dateStrSettings" display="inline"></mbsc-calendar>
    </mbsc-form-group>
    <mbsc-form-group>
        <mbsc-form-group-title>Moment JS</mbsc-form-group-title>
        <mbsc-calendar [(ngModel)]="moment" [options]="momentSettings" display="inline"></mbsc-calendar>
    </mbsc-form-group>
</mbsc-form>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MbscModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    HttpClientJsonpModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Calendar - Booking

Change demo
Booking
Advanced Angular Calendar booking demo with unavailable, disabled days and free selection for the next 6 months. For Angular 2/4/5/6/7/8 and Ionic 2/3/4.
import { Component } from '@angular/core';
import { mobiscroll, MbscCalendarOptions } from '@mobiscroll/angular';

mobiscroll.settings = {
    lang: '',
    theme: ''
};

let invalid = ['w1'];
const now = new Date(),
    min = new Date(now.getFullYear(), now.getMonth(), now.getDate()),
    max = new Date(now.getFullYear(), now.getMonth() + 6, now.getDate()),
    firstMonth = generateMonthEvents(now.getFullYear(), now.getMonth());

invalid = invalid.concat(firstMonth.invalid);

function getRandomDay() {
    return Math.floor(Math.random() * 100) % 28 + 1;
}

function generateMonthEvents(year: number, month: number) {
    let isDisabled: boolean,
        tempDay: Date;
    const inv = [],
        labels = [],
        disabledDays = [getRandomDay(), getRandomDay(), getRandomDay(), getRandomDay()];

    for (let i = 1; i <= new Date(year, month + 1, 0).getDate(); ++i) {
        tempDay = new Date(year, month, i, now.getHours(), now.getMinutes(), now.getSeconds());
        if (tempDay.getTime() >= now.getTime() && tempDay.getTime() <= max.getTime()) {
            isDisabled = disabledDays.indexOf(i) !== -1 || tempDay.getDay() === 1;
            if (isDisabled) {
                inv.push(tempDay);
            }
            labels.push({
                d: tempDay,
                text: isDisabled ? (tempDay.getDay() === 1 ? 'CLOSED' : 'FULL') : Math.round(Math.random() * 10) % 5 + 2 + ' SPOTS',
                color: isDisabled ? '#ccc' : '#8ada8a'
            });
        }
    }

    return {
        labels: labels,
        invalid: inv
    };
}

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})
export class AppComponent {
    calendar: Date;
    calendarSettings: MbscCalendarOptions = {
        display: 'inline',
        controls: ['calendar'],
        min: min,
        max: max,
        invalid: ['w1'],
        labels: firstMonth.labels,
        onPageLoading: function (event, inst) {
            let newItems: any;
            const year = event.firstDay.getFullYear(),
                month = event.firstDay.getMonth(),
                isEventsLoaded = (inst.settings.labels).filter(function (v) {
                    return v.d.getMonth() === month + 1;
                }).length;

            if (!isEventsLoaded) {
                newItems = generateMonthEvents(year, month + 1);
                inst.settings.labels = inst.settings.labels.concat(newItems.labels);
                inst.settings.invalid = inst.settings.invalid.concat(newItems.invalid);
            }
        }
    };
}
<mbsc-form>
    <mbsc-calendar [(ngModel)]="calendar" [options]="calendarSettings" [invalid]="myInvalid" [labels]="myLabels"></mbsc-calendar>
</mbsc-form>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MbscModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    HttpClientJsonpModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Calendar - Marked, colored & labels

Change demo
Marked, colored & labels

For additional information you can mark days with colored dots, add labels or completely color the background of the days. This offers means to add more information to the calendar that is valuable to users. Take a look at this example of marked days and description.

You can add these with exact dates, ranges, days of week, days of month and recurring dates. When processing a lot of data you can load the marked days, labels, colors dynamically in the onPageChange event.

Looking for an event calendar?  We have a component for that →
import { Component } from '@angular/core';
import { mobiscroll } from '@mobiscroll/angular';

mobiscroll.settings = {
    lang: '',
    theme: ''
};

const now = new Date();

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})
export class AppComponent {
    markedDay: Date;
    colorDay: Date;
    labelDay: Date;

    markedDays = [
        { d: '5/1', color: '#ffc400' },
        { d: '12/24', color: '#ffee00' },
        { d: '12/25', color: 'red' },
        { d: new Date(now.getFullYear(), now.getMonth() + 1, 4) },
        { d: new Date(now.getFullYear(), now.getMonth() - 2, 13) },
        { d: new Date(now.getFullYear(), now.getMonth(), 2), color: '#46c4f3' },
        { d: new Date(now.getFullYear(), now.getMonth(), 6), color: '#7e56bd' },
        { d: new Date(now.getFullYear(), now.getMonth(), 11), color: '#7e56bd' },
        { d: new Date(now.getFullYear(), now.getMonth(), 19), color: '#89d7c9' },
        { d: new Date(now.getFullYear(), now.getMonth(), 28), color: '#ea4986' },
        { d: new Date(now.getFullYear(), now.getMonth(), 13), color: '#7e56bd' },
        { d: new Date(now.getFullYear(), now.getMonth(), 13), color: '#f13f77' },
        { d: new Date(now.getFullYear(), now.getMonth(), 13), color: '#89d7c9' },
        { d: new Date(now.getFullYear(), now.getMonth(), 13), color: '#8dec7d' },
        { d: new Date(now.getFullYear(), now.getMonth(), 21), color: '#ffc400' },
        { d: new Date(now.getFullYear(), now.getMonth(), 21), color: '#8dec7d' },
        {
            start: new Date(now.getFullYear(), now.getMonth() + 1, 15),
            end: new Date(now.getFullYear(), now.getMonth() + 1, 18), color: '#f4511e'
        }
    ];

    coloredDays = [
        { d: '12/8', background: '#9ccc65' },
        { d: '5/1', background: 'red' },
        { d: '12/24', background: '#fff568' },
        { d: '12/25', background: '#e88080' },
        { d: new Date(now.getFullYear(), now.getMonth() + 1, 4), background: '#cfd8dc' },
        { d: new Date(now.getFullYear(), now.getMonth() + 2, 24), background: '#9575cd' },
        { d: new Date(now.getFullYear(), now.getMonth() - 2, 13), background: '#d4e157' },
        { d: new Date(now.getFullYear(), now.getMonth() - 1, 6), background: '#f4511e' },
        { d: new Date(now.getFullYear(), now.getMonth() + 1, 6), background: '#46c4f3' },
        { d: new Date(now.getFullYear(), now.getMonth() + 1, 22), background: '#7e56bd' },
        { d: new Date(now.getFullYear(), now.getMonth() - 1, 11), background: '#46c4f3' },
        { d: new Date(now.getFullYear(), now.getMonth() - 1, 29), background: '#7e56bd' },
        { d: new Date(now.getFullYear(), now.getMonth(), 2), background: '#46c4f3' },
        { d: new Date(now.getFullYear(), now.getMonth(), 3), background: '#7e56bd' },
        { d: new Date(now.getFullYear(), now.getMonth(), 11), background: '#f13f77' },
        { d: new Date(now.getFullYear(), now.getMonth(), 19), background: '#8dec7d' },
        { d: new Date(now.getFullYear(), now.getMonth(), 28), background: '#ea4986' },
        {
            start: new Date(now.getFullYear(), now.getMonth() + 1, 15),
            end: new Date(now.getFullYear(), now.getMonth() + 1, 18), text: 'Conference', background: '#f4511e'
        }
    ];

    labelDays = [
        { d: '12/25', text: 'Christmas', color: '#f48fb1' },
        { d: '1/1', text: 'New year' },
        { d: '12/1', text: 'Meeting', color: '#ffc400' },
        { d: new Date(now.getFullYear(), now.getMonth() + 1, 4), text: 'Spa day', color: '#cfd8dc' },
        { d: new Date(now.getFullYear(), now.getMonth() + 2, 24), text: 'BD Party', color: '#9ccc65' },
        { d: new Date(now.getFullYear(), now.getMonth() - 2, 13), text: 'Exams', color: '#d4e157' },
        { d: new Date(now.getFullYear(), now.getMonth() - 1, 6), text: 'Trip', color: '#f4511e' },
        { d: new Date(now.getFullYear(), now.getMonth() + 1, 6), color: '#46c4f3', text: 'Pizza Night' },
        { d: new Date(now.getFullYear(), now.getMonth() + 1, 22), color: '#7e56bd', text: 'Beerpong' },
        { d: new Date(now.getFullYear(), now.getMonth() - 1, 11), color: '#46c4f3', text: 'Anniversary' },
        { d: new Date(now.getFullYear(), now.getMonth() - 1, 29), color: '#7e56bd', text: 'Pete BD' },
        { d: new Date(now.getFullYear(), now.getMonth(), 2), color: '#46c4f3', text: 'Ana BD' },
        { d: new Date(now.getFullYear(), now.getMonth(), 3), color: '#7e56bd', text: 'Concert' },
        { d: new Date(now.getFullYear(), now.getMonth(), 11), color: '#f13f77', text: 'Trip' },
        { d: new Date(now.getFullYear(), now.getMonth(), 19), color: '#8dec7d', text: 'Math exam' },
        { d: new Date(now.getFullYear(), now.getMonth(), 28), color: '#ea4986', text: 'Party' },
        {
            start: new Date(now.getFullYear(), now.getMonth() + 1, 15),
            end: new Date(now.getFullYear(), now.getMonth() + 1, 18), text: 'Conference', color: '#f4511e'
        }
    ];
}
<mbsc-form>
    <div class="mbsc-grid">
        <div class="mbsc-row">
            <div class="mbsc-col-sm-12 mbsc-col-md-4">
                <mbsc-form-group>
                    <mbsc-form-group-title>Marked days</mbsc-form-group-title>
                    <mbsc-calendar [(ngModel)]="markedDay" display="inline" [marked]="markedDays"></mbsc-calendar>
                </mbsc-form-group>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4">
                <mbsc-form-group>
                    <mbsc-form-group-title>Colored days</mbsc-form-group-title>
                    <mbsc-calendar [(ngModel)]="colorDay" display="inline" [colors]="coloredDays"></mbsc-calendar>
                </mbsc-form-group>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4">
                <mbsc-form-group>
                    <mbsc-form-group-title>Labels</mbsc-form-group-title>
                    <mbsc-calendar [(ngModel)]="labelDay" display="inline" [labels]="labelDays"></mbsc-calendar>
                </mbsc-form-group>
            </div>
        </div>
    </div>
</mbsc-form>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MbscModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    HttpClientJsonpModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Calendar - Marked days

Change demo
Marked days

When using marked days, users might be interested to see what each dot means. You can place a listview below for describing what everything means.

Looking for more options to mark days?  See how to add dots, colors and labels →
import { Component } from '@angular/core';
import { MbscCalendarOptions, MbscListviewOptions } from '@mobiscroll/angular';

const now = new Date();

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})
export class AppComponent {
    calendar: Date;
    calendarSettings: MbscCalendarOptions = {
        display: 'inline',
        lang: '',
        theme: '',
        layout: 'liquid',
        marked: [{
            d: new Date(now.getFullYear(), now.getMonth(), now.getDate() + 5),
            color: 'rgb(28, 161, 227)'
        }, {
            d: new Date(now.getFullYear(), now.getMonth(), now.getDate() + 6),
            color: 'rgb(28, 161, 227)'
        }, {
            d: new Date(now.getFullYear(), now.getMonth(), now.getDate() + 7),
            color: 'rgb(28, 161, 227)'
        }, {
            d: new Date(now.getFullYear(), now.getMonth() + 1, 15),
            color: 'rgb(28, 161, 227)'
        }, {
            d: '11/30',
            color: 'rgb(163, 0, 38)'
        }, {
            d: '5/23',
            color: 'rgb(163, 0, 38)'
        }, {
            d: '3/12',
            color: 'rgb(163, 0, 38)'
        }, {
            d: '14',
            color: 'rgb(204,204,0)'
        }, {
            d: 'w5',
            color: 'rgb(34, 139, 34)'
        }, {
            d: '1/1',
            color: 'rgb(250,104,0)'
        }, {
            d: '1/2',
            color: 'rgb(250,104,0)'
        }, {
            d: '6/4',
            color: 'rgb(250,104,0)'
        }, {
            d: '8/4',
            color: 'rgb(250,104,0)'
        }, {
            d: '12/25',
            color: 'rgb(250,104,0)'
        }, {
            d: '12/26',
            color: 'rgb(250,104,0)'
        }]
    };

    listviewItems = [{
        id: 1,
        text: 'Garbage collection'
    }, {
        id: 2,
        text: 'Special events'
    }, {
        id: 3,
        text: 'Town council meeting'
    }, {
        id: 4,
        text: 'Town hall closed'
    }, {
        id: 5,
        text: 'National holidays'
    }];

    listviewOptions: MbscListviewOptions = {
        lang: '',
        theme: '',
        swipe: false
    };
}
<div class="md-marked">
    <div [(ngModel)]="calendar" mbsc-calendar [mbsc-options]="calendarSettings"></div>
    <mbsc-listview [options]="listviewOptions">
        <mbsc-listview-item *ngFor="let item of listviewItems">
            <span class="md-marked-points md-points-type{{item.id}}"></span> {{item.text}}
        </mbsc-listview-item>
    </mbsc-listview>
</div>

.md-marked .md-marked-points {
    display: inline-block;
    vertical-align: middle;
    width: 7px;
    height: 7px;
    margin: 0 4px 0 0;
    border-radius: 7px;
    background: #aaa;
}

.md-marked .md-points-type1 {
    background: rgb(34, 139, 34);
}

.md-marked .md-points-type2 {
    background: rgb(163, 0, 38);
}

.md-marked .md-points-type3 {
    background: rgb(204, 204, 0);
}

.md-marked .md-points-type4 {
    background: rgb(28, 161, 227);
}

.md-marked .md-points-type5 {
    background: rgb(250, 104, 0);
}
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MbscModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    HttpClientJsonpModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Calendar - Showing week numbers

Change demo
Showing week numbers

Enable week numbers with the weekCounter setting. Counting yearly and monthly are both supported. Use it whenever it is important to users having the week number in front of them. With weekCounter: 'year' you can start the counter from the first until the last week of the year. weekCounter: 'month' restarts the counter for every month.

import { Component } from '@angular/core';
import { mobiscroll, MbscCalendarOptions } from '@mobiscroll/angular';

mobiscroll.settings = {
    lang: '',
    theme: ''
};

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})
export class AppComponent {
    yearly: Date;
    monthly: Date;

    yearlySettings: MbscCalendarOptions = {
        weekCounter: 'year',
        display: 'inline'
    };

    monthlySettings: MbscCalendarOptions = {
        weekCounter: 'month',
        display: 'inline'
    };
}
<mbsc-form>
    <div class="mbsc-grid">
        <div class="mbsc-row">
            <div class="mbsc-col-sm-12 mbsc-col-md-6">
                <mbsc-form-group>
                    <mbsc-form-group-title>Week numbers go on for a full year</mbsc-form-group-title>
                    <mbsc-calendar [(ngModel)]="yearly" [options]="yearlySettings"></mbsc-calendar>
                </mbsc-form-group>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-6">
                <mbsc-form-group>
                    <mbsc-form-group-title>Week numbers restart for every month</mbsc-form-group-title>
                    <mbsc-calendar [(ngModel)]="monthly" [options]="monthlySettings"></mbsc-calendar>
                </mbsc-form-group>
            </div>
        </div>
    </div>
</mbsc-form>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MbscModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    HttpClientJsonpModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Calendar - Month change direction

Change demo
Month change direction

For a great user experience the calendar can be navigated a couple of different ways:

  • By clicking or tapping on the little arrows above the calendar body
  • With touchpad swipe gestures
  • By grabbing and dragging the month with the mouse cursor
  • With fluid swipe gestures on touchscreens

All this works in two directions: vertically and horizontally. Change the month change direction with calendarScroll: 'vertical' and calendarScroll: 'horizontal'.

import { Component } from '@angular/core';
import { mobiscroll, MbscCalendarOptions } from '@mobiscroll/angular';

mobiscroll.settings = {
    lang: '',
    theme: ''
};

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})
export class AppComponent {
    vertical: Date;
    horizontal: Date;

    horizontalSettings: MbscCalendarOptions = {
        calendarScroll: 'horizontal',
        display: 'inline'
    };
    
    verticalSettings: MbscCalendarOptions = {
        calendarScroll: 'vertical',
        display: 'inline'
    };
}
<mbsc-form>
    <div class="mbsc-grid">
        <div class="mbsc-row">
            <div class="mbsc-col-sm-12 mbsc-col-md-6">
                <mbsc-form-group>
                    <mbsc-form-group-title>Horizontal navigation</mbsc-form-group-title>
                    <mbsc-calendar [(ngModel)]="horizontal" [options]="horizontalSettings"></mbsc-calendar>
                </mbsc-form-group>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-6">
                <mbsc-form-group>
                    <mbsc-form-group-title>Vertical navigation</mbsc-form-group-title>
                    <mbsc-calendar [(ngModel)]="vertical" [options]="verticalSettings"></mbsc-calendar>
                </mbsc-form-group>
            </div>
        </div>
    </div>
</mbsc-form>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MbscModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    HttpClientJsonpModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Calendar - Setting values

Change demo
Setting values

Values can change a couple different ways: though defaults, intracting with the UI or programatically. The calendar defaults to now, which can be easily overridden with the defaultValue setting. Values are set by interacting with the component and making a selection or it can be done programatically with the setVal method. Use the buttons setting for showing/hiding set, cancel, clear, now or add custom buttons.

import { Component } from '@angular/core';
import { mobiscroll, MbscCalendarOptions } from '@mobiscroll/angular';

mobiscroll.settings = {
    lang: '',
    theme: ''
};

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})
export class AppComponent {
    demo: Date;
    def: Date;
    customVal: Date;
    now: Date;
    custom: Date;
    auto: Date;

    defSettings: MbscCalendarOptions = {
        defaultValue: new Date(2018, 2, 2)
    };

    nowSettings: MbscCalendarOptions = {
        buttons: ['now', 'set', 'cancel']
    };

    customSettings: MbscCalendarOptions = {
        buttons: [{
                text: 'Custom',
                handler: () => {
                    this.custom = new Date(2018, 0, 1);
                }
            },
            'set',
            'cancel'
        ]
    };

    autoSettings: MbscCalendarOptions = {
        buttons: [{
            text: 'Close',
            handler: 'cancel'
        }]
    };

    setValue() {
        this.customVal = new Date(2018, 0, 2);
    }

    setToday() {
        this.customVal = new Date();
    }
}
<mbsc-form>
    <mbsc-form-group>
        <mbsc-form-group-title>Controlling the default value</mbsc-form-group-title>
        <mbsc-calendar [(ngModel)]="demo" placeholder="Please select...">Default</mbsc-calendar>
        <mbsc-calendar [(ngModel)]="def" [options]="defSettings" placeholder="Please select...">Custom default</mbsc-calendar>
    </mbsc-form-group>
    <mbsc-form-group>
        <mbsc-form-group-title>Setting a custom value</mbsc-form-group-title>
        <div class="mbsc-btn-group-block">
            <mbsc-button (click)="setValue()">02-01-2018</mbsc-button>
            <mbsc-button (click)="setToday()">Today</mbsc-button>
        </div>
        <mbsc-calendar [(ngModel)]="customVal" display="inline"></mbsc-calendar>
    </mbsc-form-group>
    <mbsc-form-group>
        <mbsc-form-group-title>Buttons API</mbsc-form-group-title>
        <mbsc-calendar [(ngModel)]="now" [options]="nowSettings" placeholder="Please select...">Default setting</mbsc-calendar>
        <mbsc-calendar [(ngModel)]="custom" [options]="customSettings" placeholder="Please select...">Custom</mbsc-calendar>
        <mbsc-calendar [(ngModel)]="auto" [options]="autoSettings" placeholder="Please select...">Auto set</mbsc-calendar>
    </mbsc-form-group>
</mbsc-form>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MbscModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    HttpClientJsonpModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Calendar - Formatting values

Change demo
Formatting values

Set the date and time format accordingly. Formats are inherited from the localization settings, but can be overriden with the dateFomat, timeFormat settings.

Interested in learning about localization?  Check out the examples below →
import { Component } from '@angular/core';
import { mobiscroll, MbscCalendarOptions } from '@mobiscroll/angular';

mobiscroll.settings = {
    lang: '',
    theme: ''
};

const now = new Date();

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})
export class AppComponent {
    date = now;
    sep = now;
    month = now;
    day = now;
    atom = now;
    cookie = now;
    datetime = now;
    datetimeDay = now;

    sepSettings: MbscCalendarOptions = {
        dateFormat: 'dd.mm.yy'
    };
    monthSettings: MbscCalendarOptions = {
        dateFormat: 'd MM yy'
    };
    daySettings: MbscCalendarOptions = {
        dateFormat: 'D d M, yy'
    };
    atomSettings: MbscCalendarOptions = {
        dateFormat: 'yy-mm-dd'
    };
    cookieSettings: MbscCalendarOptions = {
        dateFormat: 'D, dd M yy'
    };
    datetimeSettings: MbscCalendarOptions = {
        controls: ['calendar', 'time']
    };
    datetimeDaySettings: MbscCalendarOptions = {
        controls: ['calendar', 'time'],
        dateFormat: 'D d M, yy',
        timeFormat: 'H:ii'
    };
}
<mbsc-form>
    <mbsc-form-group>
        <mbsc-form-group-title>Date</mbsc-form-group-title>
        <mbsc-calendar [(ngModel)]="date">Default</mbsc-calendar>
        <mbsc-calendar [(ngModel)]="sep" [options]="sepSettings">Separator</mbsc-calendar>
        <mbsc-calendar [(ngModel)]="month" [options]="monthSettings">Month name</mbsc-calendar>
        <mbsc-calendar [(ngModel)]="day" [options]="daySettings">Day of week</mbsc-calendar>
        <mbsc-calendar [(ngModel)]="atom" [options]="atomSettings">ATOM</mbsc-calendar>
        <mbsc-calendar [(ngModel)]="cookie" [options]="cookieSettings">COOKIE</mbsc-calendar>
    </mbsc-form-group>
    <mbsc-form-group>
        <mbsc-form-group-title>Date & Time</mbsc-form-group-title>
        <mbsc-calendar [(ngModel)]="datetime" [options]="datetimeSettings">Default</mbsc-calendar>
        <mbsc-calendar [(ngModel)]="datetimeDay" [options]="datetimeDaySettings">Day name</mbsc-calendar>
    </mbsc-form-group>
</mbsc-form>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MbscModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    HttpClientJsonpModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Calendar - RTL Support

Change demo
RTL Support

Shipping with full RTL support, choose left-to-right or right-to-left with the rtl setting. The value is inherited from the localization settings and can be manually overriden by explicitly setting it true or false.

Learn more about RTL and accessibility  Browse the documentation →
import { Component } from '@angular/core';
import { mobiscroll, MbscCalendarOptions, MbscFormOptions } from '@mobiscroll/angular';

mobiscroll.settings = {
    theme: '',
    lang: ''
};

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})
export class AppComponent {
    arabic: Date;
    hebrew: Date;
    farsi: Date;
    rtl: Date;

    arabicSettings: MbscCalendarOptions = {
        lang: 'ar'
    };

    hebrewSettings: MbscCalendarOptions = {
        lang: 'he'
    };

    farsiSettings: MbscCalendarOptions = {
        lang: 'fa'
    };

    rtlSettings: MbscCalendarOptions = {
        rtl: true
    };

    formSettings: MbscFormOptions = {
        rtl: true
    }
}
<mbsc-form [options]="formSettings">
    <mbsc-form-group>
        <mbsc-form-group-title>RTL enabled by default</mbsc-form-group-title>
        <mbsc-calendar [(ngModel)]="arabic" [options]="arabicSettings" placeholder="Please Select...">Arabic</mbsc-calendar>
        <mbsc-calendar [(ngModel)]="hebrew" [options]="hebrewSettings" placeholder="Please Select...">Hebrew</mbsc-calendar>
        <mbsc-calendar [(ngModel)]="farsi" [options]="farsiSettings" placeholder="Please Select...">Farsi</mbsc-calendar>
    </mbsc-form-group>
    <mbsc-form-group>
        <mbsc-form-group-title>Manually set RTL</mbsc-form-group-title>
        <mbsc-calendar [(ngModel)]="rtl" [options]="rtlSettings" placeholder="Please Select...">RTL</mbsc-calendar>
    </mbsc-form-group>
</mbsc-form>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MbscModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    HttpClientJsonpModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Calendar - Calendar systems

Change demo
Calendar systems

The calendar supports multiple calendar systems. You can control it with the calendarSystem setting, and it supports the following options:

  • Gregorian - it is included by default
  • Jalali - it is the default system of the Persian calendar and is inlcuded within the Farsi language pack
  • Hijri - it is included in the Arabic language pack
Interested in localization?  Explore this example →
import { Component } from '@angular/core';
import { mobiscroll, MbscCalendarOptions } from '@mobiscroll/angular';

mobiscroll.settings = {
    lang: '',
    theme: ''
};

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})

export class AppComponent {
    gregorian: Date;
    jalali: Date;
    hijri: Date;

    gregorianSettings: MbscCalendarOptions = {
        display: 'inline',
        calendarSystem: 'gregorian'
    };

    jalaliSettings: MbscCalendarOptions = {
        display: 'inline',
        calendarSystem: 'jalali',
        lang: 'fa'
    };

    hijriSettings: MbscCalendarOptions = {
        display: 'inline',
        calendarSystem: 'hijri',
        lang: 'ar'
    };
}
<mbsc-form>
    <div class="mbsc-grid">
        <div class="mbsc-row">
            <div class="mbsc-col-sm-12 mbsc-col-md-4">
                <mbsc-form-group>
                    <mbsc-form-group-title>Gregorian calendar</mbsc-form-group-title>
                    <mbsc-calendar [(ngModel)]="gregorian" [options]="gregorianSettings"></mbsc-calendar>
                </mbsc-form-group>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4">
                <mbsc-form-group>
                    <mbsc-form-group-title>Jalali calendar</mbsc-form-group-title>
                    <mbsc-calendar [(ngModel)]="jalali" [options]="jalaliSettings"></mbsc-calendar>
                </mbsc-form-group>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4">
                <mbsc-form-group>
                    <mbsc-form-group-title>Hijri calendar</mbsc-form-group-title>
                    <mbsc-calendar [(ngModel)]="hijri" [options]="hijriSettings"></mbsc-calendar>
                </mbsc-form-group>
            </div>
        </div>
    </div>
</mbsc-form>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MbscModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    HttpClientJsonpModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Calendar - Localization

Change demo
Localization

The components are fully localized. In case of the calendar this covers date and time format, button copy, rtl and more. You can see how each example shows up by clicking on the small flag icon or checking the examples below.

All settings can be manually overriden  See what options the localization impacts →
import { Component } from '@angular/core';
import { mobiscroll, MbscCalendarOptions } from '@mobiscroll/angular';

mobiscroll.settings = {
    theme: '',
    display: 'bubble'
};

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})

export class AppComponent {
    englishSettings: MbscCalendarOptions = {
        lang: 'en'
    };

    arabicSettings: MbscCalendarOptions = {
        lang: 'ar'
    };

    bulgarianSettings: MbscCalendarOptions = {
        lang: 'bg'
    };

    catalaSettings: MbscCalendarOptions = {
        lang: 'ca'
    };

    cestinaSettings: MbscCalendarOptions = {
        lang: 'cs'
    };

    chineseSettings: MbscCalendarOptions = {
        lang: 'zh'
    };

    croatianSettings: MbscCalendarOptions = {
        lang: 'hr'
    };

    danskSettings: MbscCalendarOptions = {
        lang: 'da'
    };

    deutschSettings: MbscCalendarOptions = {
        lang: 'de'
    };

    englishUkSettings: MbscCalendarOptions = {
        lang: 'en-UK'
    };

    espanolSettings: MbscCalendarOptions = {
        lang: 'es'
    };

    francaisSettings: MbscCalendarOptions = {
        lang: 'fr'
    };

    greekSettings: MbscCalendarOptions = {
        lang: 'el'
    };

    hindiSettings: MbscCalendarOptions = {
        lang: 'hi'
    };

    italianoSettings: MbscCalendarOptions = {
        lang: 'it'
    };

    japaneseSettings: MbscCalendarOptions = {
        lang: 'ja'
    };

    koreanSettings: MbscCalendarOptions = {
        lang: 'ko'
    };

    lietuviuSettings: MbscCalendarOptions = {
        lang: 'lt'
    };

    magyarSettings: MbscCalendarOptions = {
        lang: 'hu'
    };

    nederlandsSettings: MbscCalendarOptions = {
        lang: 'nl'
    };

    norskSettings: MbscCalendarOptions = {
        lang: 'no'
    };

    polskiSettings: MbscCalendarOptions = {
        lang: 'pl'
    };

    portuguesSettings: MbscCalendarOptions = {
        lang: 'pt-PT'
    };

    brasileiroSettings: MbscCalendarOptions = {
        lang: 'pt-BR'
    };

    romanaSettings: MbscCalendarOptions = {
        lang: 'ro'
    };

    serbianSettings: MbscCalendarOptions = {
        lang: 'sr'
    };

    slovencinaSettings: MbscCalendarOptions = {
        lang: 'sk'
    };

    suomiSettings: MbscCalendarOptions = {
        lang: 'fi'
    };

    svenskaSettings: MbscCalendarOptions = {
        lang: 'sv'
    };

    thaiSettings: MbscCalendarOptions = {
        lang: 'th'
    };

    turkceSettings: MbscCalendarOptions = {
        lang: 'tr'
    };

    ukrainianSettings: MbscCalendarOptions = {
        lang: 'ua'
    };

    vietnameseSettings: MbscCalendarOptions = {
        lang: 'vi'
    };

    russianSettings: MbscCalendarOptions = {
        lang: 'ru'
    };

    russianUaSettings: MbscCalendarOptions = {
        lang: 'ru-UA'
    };

    hebrewSettings: MbscCalendarOptions = {
        lang: 'he'
    };

    farsiSettings: MbscCalendarOptions = {
        lang: 'fa'
    };
}
<mbsc-form input-style="box" class="md-localization">
    <div class="mbsc-grid mbsc-form-grid">
        <div class="mbsc-row">
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="english" [options]="englishSettings" placeholder="Please Select...">
                    <span class="flag flag-en"></span> English
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="arabic" [options]="arabicSettings" placeholder="Please Select...">
                    <span class="flag flag-ar"></span> Arabic
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="bulgarian" [options]="bulgarianSettings" placeholder="Please Select...">
                    <span class="flag flag-bg"></span> Bulgarian
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="catala" [options]="catalaSettings" placeholder="Please Select...">
                    <span class="flag flag-ca"></span> Català
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="cestina" [options]="cestinaSettings" placeholder="Please Select...">
                    <span class="flag flag-cs"></span> Cestina
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="chinese" [options]="chineseSettings" placeholder="Please Select...">
                    <span class="flag flag-zh"></span> Chinese
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="croatian" [options]="croatianSettings" placeholder="Please Select...">
                    <span class="flag flag-hr"></span> Croatian
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="dansk" [options]="danskSettings" placeholder="Please Select...">
                    <span class="flag flag-da"></span> Dansk
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="deutsch" [options]="deutschSettings" placeholder="Please Select...">
                    <span class="flag flag-de"></span> Deutsch
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="englishUk" [options]="englishUkSettings" placeholder="Please Select...">
                    <span class="flag flag-en-UK"></span> English (UK)
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="espanol" [options]="espanolSettings" placeholder="Please Select...">
                    <span class="flag flag-es"></span> Español
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="francais" [options]="francaisSettings" placeholder="Please Select...">
                    <span class="flag flag-fr"></span> Français
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="greek" [options]="greekSettings" placeholder="Please Select...">
                    <span class="flag flag-gr"></span> Greek
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="hindi" [options]="hindiSettings" placeholder="Please Select...">
                    <span class="flag flag-in"></span> Hindi
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="italiano" [options]="italianoSettings" placeholder="Please Select...">
                    <span class="flag flag-it"></span> Italiano
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="japanese" [options]="japaneseSettings" placeholder="Please Select...">
                    <span class="flag flag-ja"></span> Japanese
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="korean" [options]="koreanSettings" placeholder="Please Select...">
                    <span class="flag flag-kr"></span> Korean
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="lietuviu" [options]="lietuviuSettings" placeholder="Please Select...">
                    <span class="flag flag-lt"></span> Lietuvių
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="magyar" [options]="magyarSettings" placeholder="Please Select...">
                    <span class="flag flag-hu"></span> Magyar
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="nederlands" [options]="nederlandsSettings" placeholder="Please Select...">
                    <span class="flag flag-nl"></span> Nederlands
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="norsk" [options]="norskSettings" placeholder="Please Select...">
                    <span class="flag flag-no"></span> Norsk
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="polski" [options]="polskiSettings" placeholder="Please Select...">
                    <span class="flag flag-pl"></span> Polski
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="portugues" [options]="portuguesSettings" placeholder="Please Select...">
                    <span class="flag flag-pt-PT"></span> Português Europeu
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="brasileiro" [options]="brasileiroSettings" placeholder="Please Select...">
                    <span class="flag flag-pt-BR"></span> Pt. Brasileiro
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="romana" [options]="romanaSettings" placeholder="Please Select...">
                    <span class="flag flag-ro"></span> Româna
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="serbian" [options]="serbianSettings" placeholder="Please Select...">
                    <span class="flag flag-sr"></span> Serbian
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="slovencina" [options]="slovencinaSettings" placeholder="Please Select...">
                    <span class="flag flag-sk"></span> Slovencina
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="suomi" [options]="suomiSettings" placeholder="Please Select...">
                    <span class="flag flag-fi"></span> Suomi
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="svenska" [options]="svenskaSettings" placeholder="Please Select...">
                    <span class="flag flag-sv"></span> Svenska
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="thai" [options]="thaiSettings" placeholder="Please Select...">
                    <span class="flag flag-th"></span> Thai
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="turkce" [options]="turkceSettings" placeholder="Please Select...">
                    <span class="flag flag-tr"></span> Türkçe
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="ukrainian" [options]="ukrainianSettings" placeholder="Please Select...">
                    <span class="flag flag-ua"></span> Ukrainian
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="vietnamese" [options]="vietnameseSettings" placeholder="Please Select...">
                    <span class="flag flag-vi"></span> Vietnamese
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="russian" [options]="russianSettings" placeholder="Please Select...">
                    <span class="flag flag-ru"></span> Русский
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="russianUa" [options]="russianUaSettings" placeholder="Please Select...">
                    <span class="flag flag-ru-UA"></span> Русский (UA)
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="hebrew" [options]="hebrewSettings" placeholder="Please Select...">
                    <span class="flag flag-he"></span> עברית
                </mbsc-calendar>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-4 mbsc-col-xl-3">
                <mbsc-calendar [(ngModel)]="farsi" [options]="farsiSettings" placeholder="Please Select...">
                    <span class="flag flag-fa"></span> فارسی
                </mbsc-calendar>
            </div>
        </div>
    </div>
</mbsc-form>
.md-localization span.flag {
    width: 22px;
    height: 15px;
    position: absolute;
    left: 1em;
    z-index: 1;
    top: 8px;
}

.mbsc-rtl .md-localization span.flag {
    right: 1em;
}

.mbsc-ios .md-localization span.flag {
    top: 15px;
}

.md-localization .flag~.mbsc-label {
    margin-left: 38px;
}

.mbsc-rtl .md-localization .flag~.mbsc-label {
    margin-right: 38px;
}

.md-localization img.flag {
    width: 30px;
}

.md-localization .flag {
    background: url(https://img.mobiscroll.com/demos/flags/flags_responsive.png) no-repeat;
    background-size: 100%;
}

.md-localization .flag-en {
    background-position: 0 93.38843%;
}

.md-localization .flag-ar {
    background-position: 0 76.033058%;
}

.md-localization .flag-bg {
    background-position: 0 9.090909%;
}

.md-localization .flag-ca {
    background-position: 0 14.876033%;
}

.md-localization .flag-cs {
    background-position: 0 21.900826%;
}

.md-localization .flag-zh {
    background-position: 0 19.008264%;
}

.md-localization .flag-hr {
    background-position: 0 38.429752%;
}

.md-localization .flag-da {
    background-position: 0 23.140496%;
}

.md-localization .flag-de {
    background-position: 0 22.31405%;
}

.md-localization .flag-en-UK {
    background-position: 0 92.561983%;
}

.md-localization .flag-es {
    background-position: 0 26.859504%;
}

.md-localization .flag-fr {
    background-position: 0 29.752066%;
}

.md-localization .flag-gr {
    background-position: 0 34.710744%;
}

.md-localization .flag-in {
    background-position: 0 40.909091%;
}

.md-localization .flag-it {
    background-position: 0 42.975207%;
}

.md-localization .flag-ja {
    background-position: 0 44.214876%;
}

.md-localization .flag-kr {
    background-position: 0 47.520661%;
}

.md-localization .flag-lt {
    background-position: 0 52.066116%;
}

.md-localization .flag-hu {
    background-position: 0 39.256198%;
}

.md-localization .flag-nl {
    background-position: 0 65.289256%;
}

.md-localization .flag-no {
    background-position: 0 65.702479%;
}

.md-localization .flag-pl {
    background-position: 0 70.661157%;
}

.md-localization .flag-pt-PT {
    background-position: 0 72.31405%;
}

.md-localization .flag-pt-BR {
    background-position: 0 11.983471%;
}

.md-localization .flag-ro {
    background-position: 0 74.380165%;
}

.md-localization .flag-sr {
    background-position: 0 74.793388%;
}

.md-localization .flag-sk {
    background-position: 0 79.752066%;
}

.md-localization .flag-fi {
    background-position: 0 27.68595%;
}

.md-localization .flag-sv {
    background-position: 0 77.68595%;
}

.md-localization .flag-th {
    background-position: 0 85.950413%;
}

.md-localization .flag-tr {
    background-position: 0 89.256198%;
}

.md-localization .flag-ua {
    background-position: 0 91.735537%;
}

.md-localization .flag-vi {
    background-position: 0 96.694215%;
}

.md-localization .flag-ru {
    background-position: 0 75.206612%;
}

.md-localization .flag-ru-UA {
    background-position: 0 10.743802%;
}

.md-localization .flag-he {
    background-position: 0 40.495868%;
}

.md-localization .flag-fa {
    background-position: 0 42.14876%;
}
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MbscModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    HttpClientJsonpModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Calendar - Event hooks

Change demo
Event hooks

The calendar ships with different event hooks for deep customization. Events are triggered through the lifecycle of the component where you can tie in custom functionality and code. While users interact with the UI events like onChange, onSet, onInit ... will be triggered. Interact with the example and check the event log for the output.

For a complete list of events go to the documentation  See available lifecycle events →
Clear event log
EVENTS FIRED: 
import { Component } from '@angular/core';
import { mobiscroll, MbscCalendarOptions } from '@mobiscroll/angular';

mobiscroll.settings = {
    lang: '',
    theme: ''
};

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})
export class AppComponent {
    calendar: Date;
    calSettings: MbscCalendarOptions = {
        controls: ['calendar', 'time'],
        onInit: (event, inst) => {
            // Your custom event handler goes here
        },
        onMarkupReady: (event, inst) => {
            // Your custom event handler goes here
        },
        onBeforeShow: (event, inst) => {
            // Your custom event handler goes here
        },
        onPosition: (event, inst) => {
            // Your custom event handler goes here
        },
        onShow: (event, inst) => {
            // Your custom event handler goes here
        },
        onSet: (event, inst) => {
            // Your custom event handler goes here
        },
        onItemTap: (event, inst) => {
            // Your custom event handler goes here
        },
        onDestroy: (event, inst) => {
            // Your custom event handler goes here
        },
        onClose: (event, inst) => {
            // Your custom event handler goes here
        },
        onChange: (event, inst) => {
            // Your custom event handler goes here
        },
        onCancel: (event, inst) => {
            // Your custom event handler goes here
        },
        onBeforeClose: (event, inst) => {
            // Your custom event handler goes here
        },
        onClear: (event, inst) => {
            // Your custom event handler goes here
        },
        onDayChange: (event, inst) => {
            // Your custom event handler goes here
        },
        onPageChange: (event, inst) => {
            // Your custom event handler goes here
        },
        onPageLoaded: (event, inst) => {
            // Your custom event handler goes here
        },
        onPageLoading: (event, inst) => {
            // Your custom event handler goes here
        },
        onSetDate: (event, inst) => {
            // Your custom event handler goes here
        },
        onTabChange: (event, inst) => {
            // Your custom event handler goes here
        }
    };
}
<mbsc-form>
    <mbsc-form-group>
        <mbsc-input input-style="box" label-style="stacked" [(ngModel)]="calendar" mbsc-calendar [mbsc-options]="calSettings" #mbscCalendar="mobiscroll" placeholder="Please select...">Calendar</mbsc-input>
        <div class="mbsc-btn-group">
            <button (click)="mbscCalendar.instance.clear()">Clear</button>
            <button (click)="mbscCalendar.instance.show()">Show</button>
        </div>
    </mbsc-form-group>
</mbsc-form>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MbscModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    HttpClientJsonpModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Calendar - Theming capabilities

Change demo
Theming capabilities

The look and feel of the calendar can be deeply customized. There are four levels of customization:

  • Base themes: Choose between Mobiscroll, iOS, Android Material and Windows.
  • Light or dark: Every theme has a light and dark variant.
  • Custom themes: Use the theme builder to customize the colors and make it match your brand.
  • Custom CSS: If you need further customization, the sky is the limit with CSS overrides.

You can also see how every example looks by changing the theme in the floating action bar on the right side.

import { Component } from '@angular/core';
import { mobiscroll, MbscCalendarOptions } from '@mobiscroll/angular';

mobiscroll.settings = {
    lang: '',
    theme: ''
};

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})
export class AppComponent {
    iosDemo: Date;
    iosDarkDemo: Date;
    iosCustomDemo: Date;
    materialDemo: Date;
    materialDarkDemo: Date;
    materialCustomDemo: Date;
    windowsDemo: Date;
    windowsDarkDemo: Date;
    windowsCustomDemo: Date;
    mobiscrollDemo: Date;
    mobiscrollDarkDemo: Date;
    mobiscrollCustomDemo: Date;

    iosSettings: MbscCalendarOptions = {
        theme: 'ios',
        display: 'bubble',
        touchUi: false
    };
    iosDarkSettings: MbscCalendarOptions = {
        theme: 'ios-dark',
        display: 'bubble',
        touchUi: false
    };
    iosCustomSettings: MbscCalendarOptions = {
        theme: 'ios-gray',
        display: 'bubble',
        touchUi: false
    };
    materialSettings: MbscCalendarOptions = {
        theme: 'material',
        display: 'bubble',
        touchUi: false
    };
    materialDarkSettings: MbscCalendarOptions = {
        theme: 'material-dark',
        display: 'bubble',
        touchUi: false
    };
    materialCustomSettings: MbscCalendarOptions = {
        theme: 'material-indigo',
        display: 'bubble',
        touchUi: false
    };
    windowsSettings: MbscCalendarOptions = {
        theme: 'windows',
        display: 'bubble',
        touchUi: false
    };
    windowsDarkSettings: MbscCalendarOptions = {
        theme: 'windows-dark',
        display: 'bubble',
        touchUi: false
    };
    windowsCustomSettings: MbscCalendarOptions = {
        theme: 'windows-yellow',
        display: 'bubble',
        touchUi: false
    };
    mobiscrollSettings: MbscCalendarOptions = {
        theme: 'mobiscroll',
        display: 'bubble',
        touchUi: false
    };
    mobiscrollDarkSettings: MbscCalendarOptions = {
        theme: 'mobiscroll-dark',
        display: 'bubble',
        touchUi: false
    };
    mobiscrollCustomSettings: MbscCalendarOptions = {
        theme: 'mobiscroll-lime',
        display: 'bubble',
        touchUi: false
    };
}
<mbsc-form>
    <div class="mbsc-grid mbsc-grid-fixed">
        <div class="mbsc-row">
            <div class="mbsc-col-sm-12 mbsc-col-md-6">
                <mbsc-form-group inset>
                    <mbsc-form-group-title>iOS Theme</mbsc-form-group-title>
                    <label>
                        Light
                        <input [(ngModel)]="iosDemo" mbsc-calendar [mbsc-options]="iosSettings" placeholder="Please Select..." />
                    </label>
                    <label>
                        Dark
                        <input [(ngModel)]="iosDarkDemo" mbsc-calendar [mbsc-options]="iosDarkSettings" placeholder="Please Select..." />
                    </label>
                    <label>
                        Custom
                        <input [(ngModel)]="iosCustomDemo" mbsc-calendar [mbsc-options]="iosCustomSettings" placeholder="Please Select..." />
                    </label>
                </mbsc-form-group>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-6">
                <mbsc-form-group inset>
                    <mbsc-form-group-title>Material Theme</mbsc-form-group-title>
                    <label>
                        Light
                        <input [(ngModel)]="materialDemo" mbsc-calendar [mbsc-options]="materialSettings" placeholder="Please Select..." />
                    </label>
                    <label>
                        Dark
                        <input [(ngModel)]="materialDarkDemo" mbsc-calendar [mbsc-options]="materialDarkSettings" placeholder="Please Select..." />
                    </label>
                    <label>
                        Custom
                        <input [(ngModel)]="materialCustomDemo" mbsc-calendar [mbsc-options]="materialCustomSettings" placeholder="Please Select..." />
                    </label>
                </mbsc-form-group>
            </div>
        </div>
        <div class="mbsc-row">
            <div class="mbsc-col-sm-12 mbsc-col-md-6">
                <mbsc-form-group inset>
                    <mbsc-form-group-title>Windows Theme</mbsc-form-group-title>
                    <label>
                        Light
                        <input [(ngModel)]="windowsDemo" mbsc-calendar [mbsc-options]="windowsSettings" placeholder="Please Select..." />
                    </label>
                    <label>
                        Dark
                        <input [(ngModel)]="windowsDarkDemo" mbsc-calendar [mbsc-options]="windowsDarkSettings" placeholder="Please Select..." />
                    </label>
                    <label>
                        Custom
                        <input [(ngModel)]="windowsCustomDemo" mbsc-calendar [mbsc-options]="windowsCustomSettings" placeholder="Please Select..." />
                    </label>
                </mbsc-form-group>
            </div>
            <div class="mbsc-col-sm-12 mbsc-col-md-6">
                <mbsc-form-group inset>
                    <mbsc-form-group-title>Mobiscroll Theme</mbsc-form-group-title>
                    <label>
                        Light
                        <input [(ngModel)]="mobiscrollDemo" mbsc-calendar [mbsc-options]="mobiscrollSettings" placeholder="Please Select..." />
                    </label>
                    <label>
                        Dark
                        <input [(ngModel)]="mobiscrollDarkDemo" mbsc-calendar [mbsc-options]="mobiscrollDarkSettings" placeholder="Please Select..." />
                    </label>
                    <label>
                        Custom
                        <input [(ngModel)]="mobiscrollCustomDemo" mbsc-calendar [mbsc-options]="mobiscrollCustomSettings" placeholder="Please Select..." />
                    </label>
                </mbsc-form-group>
            </div>
        </div>
    </div>
</mbsc-form>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MbscModule } from '@mobiscroll/angular';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MbscModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    HttpClientJsonpModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Looking for something you didn't see or have a sales question?
Ask us about it, we're here to help.

Component license


Purchase component licenses if you are looking for specific funcionality.

Total


All features will be included with the license.

Buy component license

Framework license


Get all 36 components, including with the Framework license.



Mobiscroll for Angular & Ionic $595


Use Javascript when building with plain and simple JS. Use jQuery when you have jQuery already included or if you are building with jQuery Mobile. Use AngularJS when building with Angular 1.x or Ionic 1. Use Angular when building with Angular 2/4/5/6/7/8 or Ionic 2/3/4. Use it when you are building your app or website with React.


Buy framework license
See other licensing options

Framework license


Get all 36 components, including with the Framework license.



Mobiscroll for Angular $595


  • Use it when building with plain and simple JS
  • Compatible with vanilla JS app or frameworks like Vue
  • Royalty-free commercial usage
  • Technical support is included with the license
  • Use it with jQuery and jQuery Mobile
  • Enjoy the familiar API if you already use jQuery
  • Royalty-free commercial usage
  • Technical support is included with the license
  • Use it with Angular JS and Ionic 1
  • For web and mobile apps based on Angular 1.x
  • Royalty-free commercial usage
  • Technical support is included with the license
  • Use it with Angular and Ionic 2/3/4
  • Visual Studio and VS Code integration
  • Royalty-free commercial usage
  • Technical support is included with the license
  • Use it when building with React JS
  • Collection of UI components for web and mobile
  • Royalty-free commercial usage
  • Technical support is included with the license
Buy framework license
See other licensing options

Framework license


Select the development framework you are using. Get all 36 components with the license.

Mobiscroll for Javascript
Mobiscroll for jQuery
Mobiscroll for React
Mobiscroll for Angular
Mobiscroll for Angular JS
  • Use it when building with plain and simple JS
  • Compatible with vanilla JS app or frameworks like Vue
  • Royalty-free commercial usage
  • Technical support is included with the license
  • Use it with jQuery and jQuery Mobile
  • Enjoy the familiar API if you already use jQuery
  • Royalty-free commercial usage
  • Technical support is included with the license
  • Use it with Angular JS and Ionic 1
  • For web and mobile apps based on Angular 1.x
  • Royalty-free commercial usage
  • Technical support is included with the license
  • Use it with Angular and Ionic 2/3/4
  • Visual Studio and VS Code integration
  • Royalty-free commercial usage
  • Technical support is included with the license
  • Use it when building with React JS
  • Collection of UI components for web and mobile
  • Royalty-free commercial usage
  • Technical support is included with the license
Buy framework license
See other licensing options

Select the framework you are interested in

Javascript
jQuery
Angular
Angular JS
React

Use Javascript when building with plain and simple JS.

Use jQuery when you have jQuery already included or if you are building with jQuery Mobile.

Use AngularJS when building with Angular 1.x or Ionic 1.

Use Angular when building with Angular 2/4/5/6/7/8 or Ionic 2/3/4.

Use it when you are building your app or website with React.

Do you need additional support seats?

The license comes with one support seat. ( +$100/seat )

Add the source code?

Price
Buy now
Customize & try demos locally
Sign in or start your free trial

What framework are you using?

Javascript
jQuery
AngularJS
Angular
Ionic
React
Other
Select a framework
Email address

Customize & try this demo locally
Sign in or start your free trial

We have to set you up with a trial for this to run 👍

Email address

Install demo in your app
Follow this quick, two minute install guide
Close window

Step 1.Install the Mobiscroll CLI from npm

Copy command
$ npm install -g @mobiscroll/cli

The CLI makes configuring your apps super simple 👍

Step 2.Run the following command in the root folder of your Ionic project

Copy command
$ mobiscroll config ionic
$ mobiscroll config ionic --lite

You will be prompted to log in with your mobiscroll account. Set your password here

Create an Ionic 3 & Mobiscroll starter with the CLI:

$ mobiscroll start ionic myStarter

Run this command for Ionic 4 & Mobiscroll starter:

$ mobiscroll start ionic-angular myStarter

Step 3.Copy the code into your app.

Copy TS
Copy HTML
Copy CSS
Copy Module

Step 4.Run ionic serve in the root folder of your app 🎉

Copy command
$ ionic serve

And voilà, everything should be running smoothly.

Customize & try demos locally
How would you like to do it?
Install demo in your app
Follow this quick, two minute install guide
Close window

Step 1.Install the Mobiscroll CLI from npm

Copy command
$ npm install -g @mobiscroll/cli

The CLI makes configuring your apps super simple 👍

Step 2.Run the following command in the root folder of your Angular project

Copy command
$ mobiscroll config angular
$ mobiscroll config angular --lite

You will be prompted to log in with your mobiscroll account. Set your password here

Step 3.Copy the code into your app. HTML goes into the markup, TS into Typescript.

Copy TS
Copy HTML
Copy CSS
Copy Module

Step 4.Run ng serve in the root folder of your app 🎉

Copy command
$ ng serve

And voilà, everything should be running smoothly.

Thanks for downloading
Try and customize the app locally

Extract the zip file and run the project like any Ionic app. Make sure to have Ionic CLI installed and open the terminal in the app root folder.

Step 1. Run in root folder
$ npm install
Step 2. Start the app
$ ionic serve

Let us know if we can help and enjoy!

Change your password
Need to update your password? Enter and hit the button below

You are setting a password for the account

New Password Required Enter at least 6 characters
Change your password
Need to update your password? Enter and hit the button below

Your password has been changed!

Thanks for downloading
Customize demos locally

Everything is set up so that you can dig in right away and start exploring.

We have set up a trial so that you can try the demos locally.

Extract the zip file and open the demo in your favorite browser. To install Mobiscroll in your project follow instructions from this page.


Let us know if we can help and enjoy! 👍

Thanks for downloading
Customize demos locally

Please extract the zip file and run the project like any Angular CLI app. Make sure to have the Angular CLI installed.

For installation and usage, extract the zip file and open a terminal window and follow these steps.

Step 1. Run in root folder
$ npm install
Step 2. Start the app
$ ng serve --open

Let us know if we can help and enjoy! 👍

Thanks for downloading
Customize demos locally

Everything is set up so that you can dig in right away and start exploring.

We have set up a trial so that you can try the demos locally.

The easiest way to get started is to follow the installation steps and by grabbing the code directly from the demo page. Let us know if we can help and enjoy!

You'll find a fully functional Kitchen-sink Ionic app in the zip file.

Thanks for downloading
Customize demos locally

Everything is set up so that you can dig in right away and start exploring.

We have set up a trial so that you can try the demos locally.

The demos are using Babel's in-browser ES6 and JSX transformer. Extract the zip file and open the demo in your browser. To install Mobiscroll in your project follow instructions from this page.


Let us know if we can help and enjoy! 👍

Demos
Alerts & notifications
Alert Notifications Note
Components
Alerts & notifications 3
Buttons 4
Calendar 27
Cards 14
Collapsible 3
Color 10
Date & Time 20
Event Calendar 25
Forms 13
Grid layout 7
Image 7
Inputs & fields 6
Listview 18
Measurement 10
Navigation 8
Number 8
Numpad 14
Option List 4
Popup 10
Range 19
Scroller 7
Scrollview 5
Select 18
Slider & progress 4
Styling 6
Timer 5
Timespan 6
Toggle & Radio 4
Treelist 7
Theme Select
Mobiscroll
Mobiscroll Dark
Material
Material Dark
iOS
iOS Dark
Bootstrap
Windows
Windows Dark
Display Mode
Language Locale
See other demos and change options
Theme
Display
Locale
See other demos