npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-booking-timeline

v0.1.9

Published

React booking timeline generated

Downloads

14

Readme

react-booking-timeline

React booking timeline generated.

This component has been developed to be able to display room or place reservations. It is therefore not planned to display several events at the same time for the same room/place. It also allows you to select free areas.

Note that react-booking-timeline is based on React 15.

Install

npm install react-booking-timeline

Usage

const BookingTimeline = require("react-booking-timeline");

const groups = [{ id: 1, title: 'group 1' }, { id: 2, title: 'group 2' }]
const items = [
    {
        id: 1,
        group: 1,
        title: 'First item very very very long...',
        start: moment().add(1, 'day').valueOf(),
        end: moment().add(4, 'day').valueOf(),
    },
    {
        id: 2,
        group: 2,
        title: 'item 2',
        start: moment().add(-0.5, 'day').valueOf(),
        end: moment().add(10, 'day').valueOf(),
    },
]

handleSelect = (item) => {
    console.log("item:", item)
}

render () {
    <DateTimeline
      groups={groups}
      items={items}
      onSelect=(this.handleSelect)
    />
}

Props

Name |Type |Default Value | Description |:---|:---|:---|:--- |startdate| String | moment().valueOf() | Start date of timeline |enddate|string|moment().add(6,'months').valueOf()|End date of timeline |onSelect|Function||Function called when the user selects an event |contentTooltipRender|Function|(evt) => ({evt.title}) | Function called to render the content of the tooltip. Tooltip is shown when the user clicks an event. |config|Object|see below| Config of component

Details of config prop

See below all props for the config prop

Name |Type |Default Value | Description |:---|:---|:---|:--- locale|String|"fr"|Language bgColor|String| "#8dc149"| Background color of events selectedBgColor|String| "#ffc149"| Background color of the selected event headerBgColor|String| "#519aba"| Background color of the header headerColor|String| "white"| Text color of the header freeEventBgColor|String| "#d2cdcd"| Background color of free events freeEventSelectedBgColor|String| "#d2cdcd"| Background color of the selected free event groupLabel|String| ""| Label of the first column showGroups|bool| true| Show the group's column canSelectedFreeEvent|bool| true| Show free events. User can select free events showTooltip|bool| true| Show tooltip of events tooltipClassName|String||Classname of tooltip

Example of class for tooltip:

.customeTheme {
  color: black !important;
  background-color: burlywood !important;
  &.place-top {
    &:after {
    border-top-color: burlywood !important;
    border-top-style: solid !important;
    border-top-width: 6px !important;
    }
  }
 }

Limitations

  • Test and design for React 15
  • Show only on event by group. If you have 2 events at the same time in the same group, events will be displayed on top of each other

License

MIT