Material datepicker with range support ## What is this?
npm install saturn-datepicker-lastThis is patched version of Material Datepicker for Angular with range selection support.
I created this repository and this package due to it takes a lot of time to contribute to material2 repository:
Issue #4763 in material2 repo from 2017-present.

rangeHoverEffect = false and changing between monthsrangeHoverEffectAs easy as pie.
Installation: yarn add saturn-datepicker or npm install saturn-datepicker
Import SatDatepickerModule, SatNativeDateModule and MatDatepickerModule
``angular2html`
placeholder="Choose a date"
[satDatepicker]="picker"
[value]="date">
Add styles:
* If you are using CSS: copy-paste or include somehow the file saturn-datepicker/bundle.css`
* If you are using SCSS (preferable):scss`
@import '~saturn-datepicker/theming';
@include sat-datepicker-theme($theme); // material theme data structure https://material.angular.io/guide/theming#defining-a-custom-theme
typescript
export interface SatDatepickerRangeValue {
begin: D | null;
end: D | null;
}
`
FAQ
$3
As same as for material, but with more code, just import constants from 'saturn-datepicker'.Also you need to install
@angular/material-moment-adapter package.
`
import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE, SatDatepickerModule } from 'saturn-datepicker'
import { MAT_MOMENT_DATE_FORMATS, MomentDateAdapter } from '@angular/material-moment-adapter'
@NgModule({
imports: [
SatDatepickerModule,
],
providers: [
MyReportsService,
{provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]},
{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS},
],
})
export class MyModule {
}
For advanced formatting, please look through material documentation.
`$3
orderPeriodLabel option sort the label period views.
- Default [multi-year]: multi-year then back to month
- Month [month]: month > year > multi-year`angular2html
#resultPicker
[rangeMode]="true"
orderPeriodLabel="month">
`$3
closeAfterSelection option enables or disables datepicker closing after date selections. By default the option is true`angular2html
#resultPicker
[rangeMode]="true"
[closeAfterSelection]="false">
`$3
selectFirstDateOnClose option enables or disables the selection of the first date when closing the datepicker before selecting another date.
By default the option is false`angular2html
#resultPicker
[rangeMode]="true"
[selectFirstDateOnClose]="true">
`$3
rangeHoverEffect option enables or disables the mouseover listener on days when the rangeMode parameter is used and is enabled.
By default the option is true`angular2html
#resultPicker
[rangeMode]="true"
[closeAfterSelection]="false"
[rangeHoverEffect]="false">
``---
Licence: MIT