Giter Club home page Giter Club logo

rbc-week-am-pm's Introduction

React Big Calendar Week with 12 Hour Clock

This is an exploratory repository where I try to set up the React Big Calendar component to display a twelve hour clock in the week view.

You can view the compiled app at GitHub Pages. It is served from the docs directory which is just the build directory from CRA's npm run build renamed so that it works with GitHub Pages without having to have the artifacts in the repository directory root.

This being an exploratory repository, success is not guaranteed, I am putting down my notes as I go about figuring this out. If you care only for the outcome, scroll all the way down/

To install RBC, do:

npm install react-big-calendar moment --save
npm install @types/react-big-calendar --save-dev

Next step is to pull the calendar stylesheet, set up the Moment localizer and the calendar.

Using the min and max properties it seems to be possible to cap the start and end time of all of the calendar days at once. The calendar seems to only care about the time portion and doesn't care about the date. Initially I set it up so that the min date was the first day in the week view and the max date was the last day in the week view, but that proved unnecessary.

This of course means that we cannot, as far as the current RBC API goes, have a week calendar starting at Monday noon and ending at Sunday noon. That would collapse the calendar to nothing as the difference between noon and noon only time-wise is zero.

Now is the point where I realize I misunderstood the requirements, it was not about trimming the calendar to a less than 24 hour range, but about flipping between a 12 and 24 hour clock display in the clock column and ensuring the calendar scrolls and doesn't cause its parent container height to grow to accomodate all of its height.

This repository will thus serve as an example of trimming the RBC timegrid range in the week view no one asked for on needs probably.

rbc-week-am-pm's People

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.