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

react-windatepicker

v1.0.6

Published

React date input package with windows skin

Downloads

5

Readme

React WinDatepicker

WinDatepicker gif demo

Description

A react custom date picker with Windows 10 skin and customizable colors

Functionalities

  • Navigate through dates or months
  • Switch from dates to months or months to dates
  • Set up a min and max range for clickable dates/months
  • Multiple language support to translate months and weekdays (english and french for now)

Installation

npm i react-windatepicker

Usage

import "react-windatepicker/style.css";
import { WinDatePicker } from "react-windatepicker";

const App = () => {

  function handleDateChange(date) {
    console.log(date)
  }

  return (
    <WinDatePicker
      inputProps={{
        onDateChange: handleDateChange
      }}
    />
  )
}

Props

| Props | Description | Required | |--|--|--| | inputProps | props to apply on input | true | | calendarColors | custom colors to apply on calendar | false |

inputProps

| Key name | Type | Description | required | |--|--|--|--| | setTodayByDefault | boolean |Sets input value to today, default to false | false | | onDateChange | function | Date update callback. The argument will give back an object with the raw retrieved date and the date formatted as a YYYY-MM-DD string format | true | | React input props | any | You can pass any react input props to complete | false |

calendarColors

| Key name | Type | Description | |------------------------------------|--------|------------------------------------------| | background | string | Calendar background color | | headerButtons | string | Color of calendar header buttons (up/down arrows and months/dates switch) | | headerButtonsHover | string | Color of header buttons on hover | | weekDays | string | Color of weekdays | | datesButtonsBorderHover | string | Color of date/month buttons border on hover | | datesFromChosenMonthButtons | string | Color of date/month buttons from the chosen month/year | | datesFromChosenMonthButtonsBackground | string | Background color of date/month buttons from the chosen month/year | | datesFromChosenMonthButtonsBorder | string | Border color of date/month buttons from the chosen month/year | | date/monthsOutsideChosenMonthButtons | string | Color of date/month buttons outside the chosen month/year | | selectedDateButton | string | Color of selected date/month button | | selectedDateButtonBackground | string | Background color of selected date/month button | | selectedDateButtonBorder | string | Border color of selected date/month button | | todayButton | string | Color of today's date/month button | | todayButtonBackground | string | Background color of today's date/month button | | todayButtonBorder | string | Border color of today's date/month button | | todayButtonSecondBorder | string | Second border color of today's date/month button (smaller than the first one) | | weekendsButtonsBackground | string | Background color of weekend date/month buttons | | disabledButtons | string | Color of disabled date/month buttons (dates / month and up/down arrows buttons) | | disabledButtonsBackground | string | Background color of disabled date/month buttons | | clickedButton | string | Color of clicked date/month button |

Types

type Color = string

interface CalendarColors {
    background?: Color
    headerButtons?: Color
    headerButtonsHover?: Color
    weekDays?: Color
    datesButtonsBorderHover?: Color
    datesFromChosenMonthButtons?: Color
    datesFromChosenMonthButtonsBackground?: Color
    datesFromChosenMonthButtonsBorder?: Color
    datesOutsideChosenMonthButtons?: Color
    selectedDateButton?: Color
    selectedDateButtonBackground?: Color
    selectedDateButtonBorder?: Color
    todayButton?: Color
    todayButtonBackground?: Color
    todayButtonBorder?: Color
    todayButtonSecondBorder?: Color
    weekendsButtonsBackground?: Color
    disabledButtons?: Color
    disabledButtonsBackground?: Color
    clickedButton?: Color
}

type OnDateChange = {
    /** "YYYY-MM-DD" format */
    formatted: string | ""
    /** Date format */
    raw: Date | null
}

WinDatePickerProps {
  inputProps:
  /** Any react input props */
  ComponentProps<"input"> & {
    /** required date update callback */
    onDateChange: (date: OnDateChange) => any
    /** sets input value to today, default to false */
    setTodayByDefault?: boolean
  }
  calendarColors?: CalendarColors
}

Examples

You can find some examples here : Link

CodeSandbox examples :

Basic (With TypeScript): Link

Colors : Link

Range : Link

TBA

  • More translated langs
  • Accessibility improvement with keyboard navigation