React-dates: How can I change date's cell size

Created on 23 Jun 2017  路  6Comments  路  Source: airbnb/react-dates

Hello!
Love this plugin! One reason is that it is very customizable. But when I tried to change the date's cell size I found that it build with table element, and width and height of the cell are not set in css, but hardcoded in javascript. How can I change date's cell size?

Most helpful comment

daySize set the width and height -1, is there a way to set width and height to different values?

All 6 comments

Hi @erjantj, the DateRangePicker and SingleDatePicker component both take a daySize prop that you can set to a specific pixel value. The reason for this number to be in JS instead of CSS is due to how the animations are affected.

You can see how this is done in the storybook example in https://github.com/airbnb/react-dates/blob/master/stories/DateRangePicker_calendar.js#L57-L59

@majapw just a heads up daySize prop doesn't appear in documentation, but does appear in the storybooks. That's what brought me here.

Whoops! You're right.

Changing daySize does not take any effect in my case, is there more legit way of changing a cell size?

daySize set the width and height -1, is there a way to set width and height to different values?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aaronjensen picture aaronjensen  路  52Comments

wub picture wub  路  20Comments

comron picture comron  路  22Comments

asulaiman picture asulaiman  路  28Comments

nkint picture nkint  路  21Comments