@muaazh/datepicker
Fork of a fork of the official Material Datepicker for Angular with time picking support.
- Disabled 12 hours by default
The datepicker allows users to enter a date either through text input, or by choosing a date from the calendar.
Installation
npm install @muaazh/datepicker
# or
yarn add @muaazh/datepicker
Then add the modules to your Angular module, or replace the ones imported from @angular/material/datepicker
with these:
import { MatDatepickerModule } from '@muaazh/datepicker';
import { MatNativeDateModule } from '@muaazh/datepicker/core';
@NgModule({
imports: [
MatNativeDateModule,
MatDatepickerModule,
...
],
...
})
export class AppModule {}
<mat-form-field>
<mat-label>Choose a datetime</mat-label>
<input matInput [matDatepicker]="picker" formControlName="datetime" />
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker type="datetime" #picker></mat-datepicker>
</mat-form-field>