React-big-calendar: Customize the Hour range

Created on 15 Dec 2017  路  4Comments  路  Source: jquense/react-big-calendar

Hi, I want to use the calendar only show the hour from 10.am to 10.pm , and how can I to set this,
I see the doc and still don't know how to do,
Thanks

Most helpful comment

@kweisamx You can set a min and max property on the calendar. See here

http://intljusticemission.github.io/react-big-calendar/examples/index.html#prop-min

<Calendar 
   min={new Date(2017, 10, 0, 10, 0, 0)}
   max={new Date(2017, 10, 0, 22, 0, 0)} 
/>

Is this what you are looking for?

All 4 comments

@kweisamx You can set a min and max property on the calendar. See here

http://intljusticemission.github.io/react-big-calendar/examples/index.html#prop-min

<Calendar 
   min={new Date(2017, 10, 0, 10, 0, 0)}
   max={new Date(2017, 10, 0, 22, 0, 0)} 
/>

Is this what you are looking for?

Yup the min and max props are the way to go, thanks!

min={new Date(2017, 10, 0, 10, 0, 0)}
max={new Date(2017, 10, 0, 22, 0, 0)}

How should I interpret the above lines? Why do we have 2017, 10, 0 if we are in 2019 calendar year (but it still seems to work)?

min={new Date(0, 0, 0, 10, 0, 0)}
max={new Date(0, 0, 0, 22, 0, 0)}

you can set your range time as you see and it will work, too

Was this page helpful?
0 / 5 - 0 ratings

Related issues

connercms picture connercms  路  3Comments

nirchernia picture nirchernia  路  3Comments

mathieusanchez picture mathieusanchez  路  4Comments

The-Oracle picture The-Oracle  路  3Comments

npalansky picture npalansky  路  3Comments