0.0.0-beta.33 • Published 3 years ago
b5r-bonjour v0.0.0-beta.33
Bonjour.js – B5R
Accessible and dependency-free calendar JavaScript library: import the code you need and use your UI controls.
Getting Started
Install
npm
npm i b5r-bonjour --saveYarn
yarn add b5r-bonjourTree Shaking
Bonjour was designed to be able to do Treeshaking. This technique allows you to reduce the size of the final build by including only the code you use.
Example
import { B5rEvent } from 'b5r-bonjour';
import { B5rMonthView } from 'b5r-bonjour/lib/month-view';
import { B5rWeekView } from 'b5r-bonjour/lib/week-view';Examples
Week View
HTML
<!-- Calendar -->
<div id="calendarWeekView"></div>
<!-- Your UI controls -->
<button id="btnToday">Today</button>
<button id="btnPrevious">Previous</button>
<button id="btnNext">Next</button>
<button id="btnAdd">Add event</button>TypeScript
import { B5rWeekView } from 'b5r-bonjour/lib/week-view';
const CalendarWeekView = new B5rWeekView(
document.getElementById('calendarWeekView'),
{
mode: '7-days',
}
);
document
.getElementById('btnToday')
.addEventListener('click', () => {
CalendarWeekView.today()
});
document
.getElementById('btnPrevious')
.addEventListener('click', () => {
CalendarWeekView.previous()
});
document
.getElementById('btnNext')
.addEventListener('click', () => {
CalendarWeekView.next()
});
document.getElementById('btnAdd').addEventListener('click', () => {
CalendarWeekView.setEvents([
{
id: '1',
title: 'Event 1',
subtitle: 'Subtitle',
dateRange: {
start: new Date(),
end: new Date(new Date().setHours(new Date().getHours() + 2)),
},
},
]);
});Contribution
Build Project
$ yarn install
$ yarn run buildStorybook
$ yarn install
$ yarn run storybook0.0.0-beta.26
3 years ago
0.0.0-beta.25
3 years ago
0.0.0-beta.28
3 years ago
0.0.0-beta.27
3 years ago
0.0.0-beta.29
3 years ago
0.0.0-beta.20
3 years ago
0.0.0-beta.22
3 years ago
0.0.0-beta.21
3 years ago
0.0.0-beta.24
3 years ago
0.0.0-beta.23
3 years ago
0.0.0-beta.31
3 years ago
0.0.0-beta.30
3 years ago
0.0.0-beta.33
3 years ago
0.0.0-beta.32
3 years ago
0.0.0-beta.19
3 years ago
0.0.0-beta.18
3 years ago
0.0.0-beta.17
3 years ago
0.0.0-beta.16
3 years ago
0.0.0-beta.15
3 years ago
0.0.0-beta.14
3 years ago
0.0.0-beta.13
3 years ago
0.0.0-beta.12
3 years ago
0.0.0-beta.11
3 years ago
0.0.0-beta.10
3 years ago
0.0.0-beta.9
3 years ago
0.0.0-beta.8
3 years ago
0.0.0-beta.7
3 years ago
0.0.0-beta.6
3 years ago
0.0.0-beta.5
3 years ago
0.0.0-beta.4
3 years ago
0.0.0-beta.3
3 years ago
0.0.0-beta.2
3 years ago
0.0.0-beta.1
3 years ago
0.0.0
3 years ago