Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions 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 provide the appropriate 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 ? dayPickerProps?.renderDay : this.renderDay}
/>
{this.maybeRenderTimePicker()}
{showActionsBar && this.renderOptionsBar()}
Expand Down Expand Up @@ -313,9 +319,9 @@ export class DatePicker extends AbstractPureComponent2<IDatePickerProps, IDatePi
shortcuts === true
? true
: shortcuts.map(shortcut => ({
...shortcut,
dateRange: [shortcut.date, undefined],
}));
...shortcut,
dateRange: [shortcut.date, undefined],
}));
return [
<Shortcuts
key="shortcuts"
Expand Down