1.3.0 • Published 2 years ago
@ahrefs/bs-react-dates v1.3.0
Reason bindings for react-dates
Reason bindings for react-dates.
Status 🚧 🏗
It is not completed, we are adding bindings as we go. Doesn't follow semver.
Installation, npm
yarn add @ahrefs/bs-react-dates
npm install --save @ahrefs/bs-react-dates
Then add @ahrefs/bs-react-dates
to bs-dependencies
in your bsconfig.json
:
{
...
"bs-dependencies": ["@ahrefs/bs-react-dates"]
}
To include styles
[%bs.raw {|require('react-dates/lib/css/_datepicker.css')|}];
react-dates
assumes that box-sizing: border-box
is set globally in your page's CSS. At least do this, to make it display properly.
.DateRangePicker *,
.SingleDatePicker *,
.DayPickerRangeController * {
box-sizing: border-box;
}
Examples
[%bs.raw {|require('react-dates/lib/css/_datepicker.css')|}];
[@react.component]
let make = () => {
let (dates, setDates) = React.useState(_ => DateRangePicker.Dates.{startDate: None, endDate: None});
let (focusedInput, setFocusedInput) = React.useState(_ => None);
<DateRangePicker
startDate=?{dates.startDate}
startDateId="startDateId"
endDate=?{dates.endDate}
endDateId="endDateId"
?focusedInput
onDatesChange={v => setDates(_ => v)}
onFocusChange={v => setFocusedInput(_ => v)}
isOutsideRange={_day => false}
/>;
};
TODO
- DateRangePicker
- SingleDatePicker
- DayPickerRangeController
- can/should I remove dep on
bs-moment
?
1.3.0
2 years ago
1.2.1
2 years ago
1.2.0
3 years ago
1.1.0
4 years ago
1.0.2
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago
0.1.0
5 years ago
0.0.15
6 years ago
0.0.14
6 years ago
0.0.13
6 years ago
0.0.12
7 years ago
0.0.9
7 years ago
0.0.8
7 years ago
0.0.7
7 years ago
0.0.6
7 years ago
0.0.5
7 years ago
0.0.4
7 years ago
0.0.3
7 years ago
0.0.2
7 years ago
0.0.1
7 years ago