npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@impervaos/react-date-picker

v0.0.1

Published

Cool react date picker by Imperva

Downloads

8

Readme

Date picker widget

coverage tests

Presentation

Installation

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

DatePickerWithPresets

Import

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

####Props

|Property | Type | Description | Default | |:--- |:---| :--- | :--- | |currentTimeStamp| number | Current time in milliseconds | null
|style| object| styling object that will be applied on the top wrapper of the component| {} |className| string| css class that will be applied on the top wrapping component| "" |presets| list | list of names and values of predefined presets (ex. { label: 'Last 24 hours', value: 86400000 } ) | [] |dateFilter| function| if you would like to limit the displayed dates with a custom function | null |includeDatePicker| boolean| should the custom date picker be displayed | true |calendarDaysRange| array | min and max value of days back that you allow to be displayed in the custom datepicker | 0, -180 |selectionDaysRange| array| min and max value of days that you can select within custom datepicker |presetsProp| list | state of the presets, mostly for being able to disable certain presets (ex. { value: 86400000, disabled: false }). value is the key |[] |onChange| function | function performed when new date is picked| null |onAnalytics| function | function that would run on any change in the component, used for google analytics reporting| null

####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

|Property | Type | Description | Default | |:--- |:---| :--- | :--- | |className| string| css class that will be applied on the top wrapping component| "" |dateFilter| function| if you would like to limit the displayed dates with a custom function | null |onApplyDateRange| function | run as a result of clicking apply| null |onChange| function | function performed when new date is picked| null |onCancel| function | function performed when cancel is clicked| null |closeRangeDatePicker| function | function that is run upon closing or opening the picker| null |onAnalytics| function | function that would run on any change in the component, used for google analytics reporting| null |isOpen| bool | true for opening the picker, false to close| null

####Code Example

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

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