Skip to content

Commit 803cf2c

Browse files
authored
[datetime] feat(DatePicker): add support for dayPickerProps.renderDay (#4012)
1 parent d0aebaa commit 803cf2c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/datetime/src/datePicker.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ export interface IDatePickerProps extends IDatePickerBaseProps, IProps {
4343
* The following props are managed by the component and cannot be configured:
4444
* `canChangeMonth`, `captionElement`, `fromMonth` (use `minDate`), `month` (use
4545
* `initialMonth`), `toMonth` (use `maxDate`).
46+
*
47+
* In case of supplying your owner `renderDay` function, make sure to apply the appropriate
48+
* CSS wrapper class to obtain default Blueprint styling.
49+
* eg.
50+
* `<div className={Classes.DATEPICKER_DAY_WRAPPER}>{CONTENT_HERE}</div>`
51+
*
4652
*/
4753
dayPickerProps?: DayPickerProps;
4854

@@ -176,7 +182,7 @@ export class DatePicker extends AbstractPureComponent2<IDatePickerProps, IDatePi
176182
onMonthChange={this.handleMonthChange}
177183
selectedDays={this.state.value}
178184
toMonth={maxDate}
179-
renderDay={this.renderDay}
185+
renderDay={dayPickerProps?.renderDay ?? this.renderDay}
180186
/>
181187
{this.maybeRenderTimePicker()}
182188
{showActionsBar && this.renderOptionsBar()}

0 commit comments

Comments
 (0)