1.2.4 • Published 6 months ago
jwf-year-calendar v1.2.4
jwf-year-calendar
A full react version of Paul-DS' js-year-calendar, https://github.com/year-calendar/js-year-calendar. Built with support from JWF Process Solutions Ltd.
Installation
- From the Node package manager, using the following command:
npm install jwf-year-calendar
ornpm i jwf-year-calendar
- From Yarn, using the following command:
yarn add jwf-year-calendar
Usage
The calendar can be created using the following javascript code :
import Calendar from 'jwf-year-calendar';
render() {
return (<Calendar />);
}
Using options
You can specify props to customize the calendar for your needs:
render() {
return (
<Calendar enableRangeSelection={true} weekStart={0}/>
);
}
The props are as follows
Option name | Description | Type | Default value |
---|---|---|---|
contextMenuItems | Specifies the items of the default context menu. This returns a callback function | array | [] |
dataSource | The elements that must be displayed on the calendar. | array or function | [] |
disabledDays | The days that must be displayed as disabled. | array | [] |
enableRangeSelection | Specifies whether the range selection is enabled. | boolean | false |
weekStart | The starting day of the week. This option overrides the parameter define in the language file. | number | 0 |
darkMode | Allows user to select if they want the contextmenu and day tile to display in dark mode or not | boolean | 'false' |
Event name | Description | Parameter |
---|---|---|
onRangeSelected | Function fired when a date range is selected. | { startDate, endDate } |
onYearChange | Function fired when the visible year of the calendar is changed. | { currentYear } |
1.2.4
6 months ago
1.2.0
7 months ago
1.1.1
8 months ago
1.1.0
8 months ago
1.0.9
8 months ago
1.0.8
8 months ago
1.0.7
8 months ago
1.1.5
7 months ago
1.2.3
7 months ago
1.1.4
7 months ago
1.2.2
7 months ago
1.1.3
7 months ago
1.2.1
7 months ago
1.1.2
8 months ago
1.0.11
8 months ago
1.0.10
8 months ago
1.0.13
8 months ago
1.0.12
8 months ago
1.0.6
8 months ago
1.0.5
8 months ago
1.0.4
8 months ago
1.0.3
8 months ago
1.0.2
8 months ago
1.0.1
8 months ago
1.0.0
8 months ago