0.1.10 • Published 3 years ago
@compeon/datepicker v0.1.10
Simple datepicker component built with react, styled-components and date-fns
Installation
yarn add @compeon/datepicker
You also need to have styled-components
installed, so if that's not the case already
yarn add styled-components
Usage
import Datepicker from '@compeon/datepicker'
<Datepicker date={new Date()} onChange={this.handleChange}>
<div>Click me</div>
</Datepicker>
Props
prop | description | default |
---|---|---|
date | the currently selected date | new Date() |
displayIsoWeek | whether to display the ISO week number next to the week | true |
locale | the locale that is used for displaying monthnames and weekday names | de |
onBlur | function that is called when the picker is blurred | - |
onFocus | function that is called when the picker is focussed | - |
onChange | function that is called when the selected date changes. First param is the selected date. Second param is always the triggering event. | - |
children | node(s) which on click trigger the opening of the picker | - |
selectableDates | either an object in the format { before: 2019, after: 2016 } (also works with only one of after or before ) or an array with the allowed dates [new Date(2018, 5, 2), new Date(2017, 5 2)] | - |
weekStartsOn | which weekday to use as the first day | 1 |
primaryColor | the primary color that is used | #27718c |
secondaryColor | the secondary color that is used | white |
hoverColor | the color that is used for hovering over a date | #d3d3d330 |
className | className passed to the outer wrapper | - |
dialogClassName | className passed to the dialog component that is rendered when the dialog is open | - |
Author
baahrens (bahrens@compeon.de)
License
MIT
0.1.10
3 years ago
0.1.9
3 years ago
0.1.7
4 years ago
0.1.7-beta.1
4 years ago
0.1.6
4 years ago
0.1.5
4 years ago
0.1.4
4 years ago
0.1.3
4 years ago
0.1.2
5 years ago
0.1.1
5 years ago
0.1.0
5 years ago
0.0.13
5 years ago
0.0.12
5 years ago
0.0.11
5 years ago
0.0.10
5 years ago
0.0.9
5 years ago
0.0.8
6 years ago
0.0.7
6 years ago
0.0.6
6 years ago
0.0.5
6 years ago
0.0.4
6 years ago
0.0.3
6 years ago
0.0.2
6 years ago
0.0.1
6 years ago