1.0.12 • Published 3 years ago

onedash-react-calendar v1.0.12

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

React.js time calendar

This guide will help you render calendar component with React.js. If you're not familiar with setting up a new React web project, please refer to the React documentation.

Install

In order to install the components run the following:

npm install onedash-react-calendar

Usage

All the described components can be imported from "onedash-react-calendar".

Example:

const [calenderDate, changeDate] = React.useState(dayjs().timestamp());
const events = React.useMemo(() => getTestData(calenderDate), [calenderDate]);
return (
	<div className="onedash-calendar-example">
		<Calendar dayNum={dayNum} onStartDateChange={changeDate} startDate={calenderDate} hourFrom={hourFrom} hourTo={hourTo}>
			<CalendarToolbarItem>
				<button>New Event</button>
			</CalendarToolbarItem>

			{events?.map((e, i) => (
				<CalendarItem key={i as any} title={e.name} from={e.from} to={e.to} className="event" />
			))}
		</Calendar>
	</div>
);

Styling

Most components come without any style. You can adjust it yourself by CSS. If you like the style in this documentation, you can use our stylesheet from here.

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago