4.0.0-beta.1 • Published 3 years ago
@vkbansal/react-date-primitives v4.0.0-beta.1
React Date Primitives
Primitives for creating Date-Picker and DateRange-Picker components in React with zero dependencies!
Installation
This package is distributed via npm.
npm install --save react-date-primitives
This package also depends on
react
. Please make sure you have those installed as well.
Usage
import * as React from 'react';
import { CalendarMonth } from 'react-date-primitives';
class SimpleDatePicker extends React.Component {
render() {
return (
<table>
<CalendarMonth
month={new Date()}
render={({ days }) => (
<tbody>
{days.map((week, i) => (
<tr key={i}>
{week.map((day, j) => (
<td key={`${i}-${j}`}>
{day.inCurrentMonth ? day.date.getDate() : ''}
</td>
))}
</tr>
))}
</tbody>
)}
/>
</table>
);
}
}
Live Examples
- simple date-picker
- simple date-picker with dropdowns for month and year
- simple daterange-picker using
CalendarMonth
- styled date-picker
useCalendar
hookuseDateRange
hook
API
License
MIT. Copyright(c) Vivek Kumar Bansal
4.0.0-beta.1
3 years ago
3.1.0
4 years ago
3.0.0
4 years ago
2.0.2
4 years ago
2.0.1
4 years ago
1.1.0
4 years ago
2.0.0
5 years ago
1.0.0
5 years ago
1.0.0-beta.6
5 years ago
1.0.0-beta.4
5 years ago
1.0.0-beta.5
5 years ago
1.0.0-beta.3
5 years ago
1.0.0-beta.2
5 years ago
1.0.0-beta.1
5 years ago
0.8.0-beta.1
5 years ago