Skip to content

Commit

Permalink
Date picker min max (#865)
Browse files Browse the repository at this point in the history
  • Loading branch information
thecalcc authored Jul 3, 2024
1 parent 61d2999 commit bc39102
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions app-typescript/components/DatePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ interface IDatePickerBase extends IInputWrapper {
interface IDatePicker extends IDatePickerBase {
value: Date | null;
onChange(valueNext: Date | null): void;
maxDate?: Date;
minDate?: Date;
showButtonBar?: boolean;
'data-test-id'?: string;
}

Expand Down Expand Up @@ -157,6 +160,7 @@ export class DatePicker extends React.PureComponent<IDatePicker, IState> {
tabindex={this.props.tabindex}
>
<Calendar
showButtonBar={this.props.showButtonBar}
inputId={this.htmlId}
ariaLabelledBy={this.htmlId + 'label'}
ref={(ref) => {
Expand Down Expand Up @@ -208,6 +212,8 @@ export class DatePicker extends React.PureComponent<IDatePicker, IState> {
)}
appendTo={document.body} // making it work inside `overflow:hidden`
disabled={this.props.disabled}
minDate={this.props.minDate}
maxDate={this.props.maxDate}
onBlur={(event) => {
// @ts-ignore: Object is possibly 'null'.
if (!event?.target.value) {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "superdesk-ui-framework",
"version": "3.1.12",
"version": "3.1.13",
"license": "AGPL-3.0",
"repository": {
"type": "git",
Expand Down

0 comments on commit bc39102

Please sign in to comment.