Skip to content

Commit

Permalink
[datetime] feat(DatePicker): add support for dayPickerProps.renderDay (
Browse files Browse the repository at this point in the history
  • Loading branch information
MalikBagwala authored Mar 16, 2020
1 parent d0aebaa commit 803cf2c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/datetime/src/datePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ export interface IDatePickerProps extends IDatePickerBaseProps, IProps {
* The following props are managed by the component and cannot be configured:
* `canChangeMonth`, `captionElement`, `fromMonth` (use `minDate`), `month` (use
* `initialMonth`), `toMonth` (use `maxDate`).
*
* In case of supplying your owner `renderDay` function, make sure to apply the appropriate
* CSS wrapper class to obtain default Blueprint styling.
* eg.
* `<div className={Classes.DATEPICKER_DAY_WRAPPER}>{CONTENT_HERE}</div>`
*
*/
dayPickerProps?: DayPickerProps;

Expand Down Expand Up @@ -176,7 +182,7 @@ export class DatePicker extends AbstractPureComponent2<IDatePickerProps, IDatePi
onMonthChange={this.handleMonthChange}
selectedDays={this.state.value}
toMonth={maxDate}
renderDay={this.renderDay}
renderDay={dayPickerProps?.renderDay ?? this.renderDay}
/>
{this.maybeRenderTimePicker()}
{showActionsBar && this.renderOptionsBar()}
Expand Down

1 comment on commit 803cf2c

@blueprint-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[datetime] feat(DatePicker): add support for dayPickerProps.renderDay (#4012)

Previews: documentation | landing | table

Please sign in to comment.