Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
react-availability-calendar
Advanced tools
A customizable React component for displaying booking availabilities on a calendar.
A customizable React component for displaying booking availabilities on a calendar.
No moment
dependency required, but accepts a moment
-like prop that needs to implement a subset of Moment
's API.
export interface AvailabilityCalendarProps {
moment: MomentCtrFunc;
theme?: CalendarThemeProp;
onCalRangeChange?: (range: Range) => any;
providerTimeZone: string;
bookings: Booking[];
initialDate: Date | null;
onAvailabilitySelected: (e: AvailabilityEvent) => any;
blockOutPeriods?: MsSinceMidnightRange[];
slotLengthMs?: number;
slotStepMs?: number;
}
pass theme={{requestAppointmentLabel: "Request Booking or other wording"}}
npm install react-availability-calendar --save
import React from 'react';
import {
AvailabilityCalendar,
AvailabilityEvent,
MsSinceMidnightRange,
Booking,
Range,
CalendarThemeProp,
} from 'react-availability-calendar';
import moment from 'moment';
import 'bootstrap/dist/css/bootstrap.min.css';
import './custom.scss';
const msInHour = 60 * 60 * 1000;
const App: React.FC = () => {
const now = new Date();
const onAvailabilitySelected = (a: AvailabilityEvent) =>
console.log('Availability slot selected: ', a);
const onChangedCalRange = (r: Range) =>
console.log('Calendar range selected (fetch bookings here): ', r);
const blockOutPeriods: MsSinceMidnightRange[] = [
[0 * msInHour, 9 * msInHour],
[19 * msInHour, 24 * msInHour],
];
const bookings: Booking[] = [
{
startDate: new Date(2020, 2, 1, 19),
endDate: new Date(2020, 2, 1, 20),
},
{
startDate: new Date(2020, 2, 1, 16, 30),
endDate: new Date(2020, 2, 1, 17),
},
];
const providerTimeZone = 'America/New_York';
return (
<div style={{ width: 350 }}>
<AvailabilityCalendar
bookings={bookings}
providerTimeZone={providerTimeZone}
moment={moment}
initialDate={now}
onAvailabilitySelected={onAvailabilitySelected}
onCalRangeChange={onChangedCalRange}
blockOutPeriods={blockOutPeriods}
/>
</div>
);
};
export default App;
cd example/example1
npm install
npm start
FAQs
A customizable React component for displaying booking availabilities on a calendar.
The npm package react-availability-calendar receives a total of 35 weekly downloads. As such, react-availability-calendar popularity was classified as not popular.
We found that react-availability-calendar demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.