Socket
Book a DemoInstallSign in
Socket

@impervaos/react-date-picker

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@impervaos/react-date-picker

Cool react date picker by Imperva

0.0.1
beta
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

Date picker widget

coverage tests

Presentation

Installation

$ npm install --save @imperva/date-picker

DatePickerWithPresets

Import

    import DatePickerWithPresets, {DateRangePicker} from "@imperva/date-picker"; 

####Props

PropertyTypeDescriptionDefault
currentTimeStampnumberCurrent time in millisecondsnull
styleobjectstyling object that will be applied on the top wrapper of the component{}
classNamestringcss class that will be applied on the top wrapping component""
presetslistlist of names and values of predefined presets (ex. { label: 'Last 24 hours', value: 86400000 } )[]
dateFilterfunctionif you would like to limit the displayed dates with a custom functionnull
includeDatePickerbooleanshould the custom date picker be displayedtrue
calendarDaysRangearraymin and max value of days back that you allow to be displayed in the custom datepicker0, -180
selectionDaysRangearraymin and max value of days that you can select within custom datepicker
presetsPropliststate of the presets, mostly for being able to disable certain presets (ex. { value: 86400000, disabled: false }). value is the key[]
onChangefunctionfunction performed when new date is pickednull
onAnalyticsfunctionfunction that would run on any change in the component, used for google analytics reportingnull

####Code Example

    import DatePickerWithPresets from "@imperva/date-picker";
    ...
    ...
    ...

    <DatePickerWithPresets
        className={"main-date-picker"}
        includeDatePicker
        dateFilter={{ startTS: null, endTS: null, offset: 0 }}
        onChange={this._onDateChange.bind(this)}
        currentTimeStamp={new Date().getTime()}
        presets={[
          { label: 'Last 24 hours', value: 86400000 },
          { label: 'Last 7 days', value: 604800000 },
          { label: 'Last 30 days', value: 2592000000 },
          { label: 'Last 90 days', value: 7776000000 },
          { label: 'Custom', value: -1 },
        ]}
        presetsProp={[
          { value: 86400000, disabled: false },
          { value: 604800000, disabled: false },
          { value: 2592000000, disabled: false },
          { value: 7776000000, disabled: false },
        ]}
        onAnalytics={(event)=>this._onDatePickerAnalytics(event)}
    />

DateRangePicker - use only the custom picker, without the presets

Import

    import {DateRangePicker} from "@imperva/date-picker"; 

####Props

PropertyTypeDescriptionDefault
classNamestringcss class that will be applied on the top wrapping component""
dateFilterfunctionif you would like to limit the displayed dates with a custom functionnull
onApplyDateRangefunctionrun as a result of clicking applynull
onChangefunctionfunction performed when new date is pickednull
onCancelfunctionfunction performed when cancel is clickednull
closeRangeDatePickerfunctionfunction that is run upon closing or opening the pickernull
onAnalyticsfunctionfunction that would run on any change in the component, used for google analytics reportingnull
isOpenbooltrue for opening the picker, false to closenull

####Code Example

    import {DateRangePicker} from "@imperva/date-picker";
    ...
    ...
    ...

    <DateRangePicker
        className={"main-date-picker"}        
        onChange={this._onDateChange.bind(this)}
    />

Keywords

react

FAQs

Package last updated on 04 Jun 2020

Did you know?

Socket

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.