1.0.4 • Published 4 months ago
automate-datepicker v1.0.4
Automate DatePicker
Automate datepicker is a simple datepicker for Automate web sites purposes.
Features
- Custom formatting
- Min/Max date restriction
- Ability to disable specific days of week
- Ability to disable specific dates
- Ability to hightlight specific dates
- Ability to change initial view (days, month, year)
- Custom template
- Accessibility
- Themes
Warning
Library is under active development and may have API breaking changes for subsequent major versions after 1.0.0.
Getting started
Step 1: Install automate-datepicker
:
NPM
npm install --save @automate-datepicker
Step 2: Import the AutomateDatePickerModule and angular FormsModule module:
import { AutomateDatePickerModule } from 'automate-datepicker';
import { FormsModule } from '@angular/forms';
@NgModule({
declarations: [AppComponent],
imports: [AutomateDatePickerModule, FormsModule],
bootstrap: [AppComponent]
})
export class AppModule {}
Usage
Define options in your consuming component:
@Component({...})
export class ExampleComponent {
selectedDate: Date;
}
In template use automate-datepicker
component with your options
<!--Using template-->
<automate-datepicker [(ngModel)]="selectedDate">
<ng-template appendToTmp let-formattedDate="formattedDate">
<button>{{formattedDate}}</button>
</ng-template>
</automate-datepicker>
<!--Simple use-->
<automate-datepicker [(ngModel)]="selectedDate">
</automate-datepicker>
API
Inputs
Outputs
Methods
Configuration: In order to provide configurations to the date-picker you need to pass it to the automate-datepicker
component:
<automate-datepicker [(ngModel)]="selectedDate" [config]="config"></automate-datepicker>
Here are the available configurations:
Screenshots
Default
Dark
Default Christmas
Dark Christmas