0.4.6 • Published 5 years ago

angular-datepickr v0.4.6

Weekly downloads
18
License
MIT
Repository
github
Last release
5 years ago

Angular-datepickr

Angular Datepicker Component

angular-datepickr is a datepicker component for Angular 2+

Demo

Desktop Desktop

Modal Modal

Installation

Required libraries: moment.js

Install angular-datepickr via npm

npm install angular-datepickr --save

Usage

import { AngularDatepickerModule } from 'angular-datepickr/dist';

@NgModule({
    declarations: [
        AppComponent
    ],
    imports: [
        CommonModule,
        ReactiveFormsModule,
        FormsModule,
        AngularDatepickerModule
    ],
    providers: [],
    bootstrap: [AppComponent]
})
export class AppModule {
}
<jb-input-datepicker formControlName="date"></jb-input-datepicker>
<jb-text-datepicker formControlName="date2"></jb-text-datepicker>

Configuration

Global configuration

export const datepickerGlobalOptions: AngularDatepickerOptions = {
    todayString: 'DNES',
    modalMediaQuery: 'max-width: 550px',
    format: 'DD.MM.YYYY',
    viewFormat: 'DD.MM.YYYY',
    firstWeekdaySunday: false,
    todayButtonEnabled: true,
    todayHighlight: true,
    weekendHighlight: true,
    closeOnSelect: true
}
AngularDatepickerModule.forRoot(datepickerGlobalOptions)

Local configuration

<jb-input-datepicker formControlName="date" [options]="{todayHighlight:'false'}"></jb-input-datepicker>
OptionDescriptionDefault
format: stringformat for model value'DD.MM.YYYY'
viewFormat: stringformat for view'DD.MM.YYYY'
firstWeekdaySunday: booleanweek in calendar starts with sundayfalse;
todayString: stringtext on the today buttonTODAY
todayButtonEnabled: booleantoday button is showntrue
todayHighlight: booleantoday is highlightedtrue
weekendHighlight: booleansaturday and sunday is highlighted with colortrue
modalMediaQuery: stringmedia query which will be matched to show calendar in modalnone

Licence

This project is licensed under the MIT license. See the LICENSE file for more info.

Contributing

Filling issues and Pull requests are welcome

0.4.6

5 years ago

0.4.5

5 years ago

0.4.4

5 years ago

0.4.3

5 years ago

0.4.2

5 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.9

7 years ago

0.3.8

7 years ago

0.3.7

7 years ago

0.3.7-beta1

7 years ago

0.3.6

7 years ago