Socket
Socket
Sign inDemoInstall

mat-daterangepicker

Package Overview
Dependencies
11
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mat-daterangepicker

Angular material date picker extension to support range selection.


Version published
Weekly downloads
160
increased by4.58%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

MatDaterangepicker

This is an extension library for the native Angular Material Datepicker. Then you can use all the options provided by the Matdatepicker material component.

Demo

Requirements

AngularVersion
angular>= 9.0.0
@angular/material>= 9.0.0

Installation

npm i mat-daterangepicker

import MatDaterangepickerModule in your module

import { MatDaterangepickerModule } from 'mat-daterangepicker';

@NgModule({
    imports: [
        MatDaterangepickerModule
    ],
    declarations: [AppComponent],
    bootstrap:    [AppComponent]
})
export class AppModule {}

Angular Material Theme

import code bellow in your material style theme to have compatibility with your current material theme.

@import 'mat-daterangepicker/mat-daterangepicker.theme.scss';

@include mat-daterangepicker-theme($theme);

Usage

// in your component
export class DaterangepickerExampleComponent {
    startDate = new Date()
    endDate = new Date()
}
<mat-form-field>
    <input matInput [matDatepicker]="dpRange" type="text" [value]="startDate" placeholder="Start Date">
    <mat-daterangepicker #dpRange></mat-daterangepicker>
</mat-form-field>
<mat-form-field>
    <input matInput [matDaterangepickerEnd]="dpRange" type="text" [value]="endDate" placeholder="End Date">
    <mat-datepicker-toggle matSuffix [for]="dpRange"></mat-datepicker-toggle>
</mat-form-field>

Options

OptionDescription
@Input() dualView: booleanAn input to display two calendars when selecting dates
@Input() applyButton: booleanAn input to display an apply button to close the calendar picker
@Input() showCustomRanges: booleanAn input to display default custom ranges options in the calendar picker
@Ouput() apply: EventEmitterFired when apply button is clicked

Mehods

MethodDescription
applyRangeApply the range and close the calendar picker
clearRangeClear the selected dates

Keywords

FAQs

Last updated on 21 Jul 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc