4.0.0-beta.1 • Published 2 years ago

@vkbansal/react-date-primitives v4.0.0-beta.1

Weekly downloads
1
License
MIT
Repository
github
Last release
2 years ago

React Date Primitives

Primitives for creating Date-Picker and DateRange-Picker components in React with zero dependencies!

NPM version Build Status

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

API

License

MIT. Copyright(c) Vivek Kumar Bansal

4.0.0-beta.1

2 years ago

3.1.0

3 years ago

3.0.0

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

1.1.0

3 years ago

2.0.0

4 years ago

1.0.0

4 years ago

1.0.0-beta.6

4 years ago

1.0.0-beta.4

4 years ago

1.0.0-beta.5

4 years ago

1.0.0-beta.3

4 years ago

1.0.0-beta.2

4 years ago

1.0.0-beta.1

4 years ago

0.8.0-beta.1

4 years ago