Socket
Socket
Sign inDemoInstall

@compeon/monthpicker

Package Overview
Dependencies
86
Maintainers
11
Versions
47
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @compeon/monthpicker

Simple monthpicker using react & date-fns


Version published
Weekly downloads
25
increased by31.58%
Maintainers
11
Install size
6.22 MB
Created
Weekly downloads
 

Changelog

Source

[0.4.13] - 2021-09-21

Changed

  • dependency updates

Readme

Source

Simple, clean monthpicker component built with react, styled-components and date-fns

Screenshot

Installation

yarn add @compeon/monthpicker

You also need to have styled-components installed, so if that's not the case already

yarn add styled-components

Usage

import Monthpicker from '@compeon/monthpicker'

<Monthpicker format='MM.yyyy' onChange={this.handleChange}>
  <div>Click me</div>
</Monthpicker>

Props

propdescriptiondefault
monththe currently selected monthnew Date().getMonth()
yearthe currently selected yearnew Date().getFullYear()
localethe locale that is used for displaying monthnamesde
formatformat the onChange function is called with. Can be anything from this listMM.yyyy
onBlurfunction that is called when the picker is blurred-
onFocusfunction that is called when the picker is focussed-
onChangefunction that is called when the selected month changes. Will be called with { month: 1, year: 2018 } as the first param when no format is specified. Second param is always the triggering event.-
childrennode(s) which on click trigger the opening of the picker-
allowedYearseither an object in the format { before: 2019, after: 2016 } (also works with only one of after or before) or an array with the allowed years [2016, 2017, 2018]-
primaryColorthe primary color that is used#27718c
secondaryColorthe secondary color that is usedwhite
hoverColorthe color that is used for hovering over a month#d3d3d330

Author

baahrens (bahrens@compeon.de)

COMPEON

License

MIT

Keywords

FAQs

Last updated on 21 Sep 2021

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