Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

min & max to offset full 24 hour days #354

Closed
IanLondon opened this issue Apr 11, 2017 · 1 comment
Closed

min & max to offset full 24 hour days #354

IanLondon opened this issue Apr 11, 2017 · 1 comment

Comments

@IanLondon
Copy link
Contributor

IanLondon commented Apr 11, 2017

I'm using moment.tz.setDefault to set the calendar in the local timezone, which may be different than the browser's timezone. Since react-big-calendar starts at 12am by default, with UTC-local = +4, the calendar starts at 4am instead, for example. I would like to make the calendar always start at 12am, in the time of the locale the calendar is for (not in the time of the user's browser).

Anyway, I tried several variations of

import moment from 'moment'
import 'moment-timezone'

moment.tz.setDefault(timezoneOfMyLocationOfInterest)

//...etc
  <MyCalendar
    min={moment().startOf('day').toDate()}
    max={moment().endOf('day').toDate()}
    ...otherProps
  />

and it seems react-big-calendar is consistently pushing all my events in a big whitespace below the calendar, outside of the row time labels. It also does this if you just make a <24hr min-max range, if you have events that fall out of this range. So it looks like it's not recognizing that the events really are inside this specified 24hr range, and that's why it's forcing them outside of the grid.

Am I doing something wrong with the props, or is this a real bug?

If I set the timezone so the events and my browser are in the same timezone, the calendar looks fine. But when there is an offset, the calendar renders events outside of the grid, or each 30min event spans the whole 24h grid and there's a big white space below it.

Thanks!

PS if this did work it might help with #118

May be related to #249

Looks like #253

@jquense jquense closed this as completed Nov 2, 2017
@jesseluowork
Copy link

@IanLondon did you ever get this working? I seem to have the same errors that you're having

image

timeslots have also disappeared...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants