Skip to content

Commit

Permalink
* datetime-picker: support for setting date forcely.
Browse files Browse the repository at this point in the history
  • Loading branch information
catouse committed Aug 22, 2024
1 parent 645fceb commit 6c4d9d6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/datetime-picker/src/component/date-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ export class DatePicker<T extends DatePickerOptions = DatePickerOptions> extends
return this._date;
}

setDate = (value: string) => {
setDate = (value: string, force?: boolean) => {
const {disabled, readonly} = this.props;
if (disabled || readonly) {
if (!force && (disabled || readonly)) {
return;
}

Expand All @@ -51,7 +51,7 @@ export class DatePicker<T extends DatePickerOptions = DatePickerOptions> extends
trigger._skipTriggerChange = value;
}
}
return this.setDate(value) as Promise<PickState>;
return this.setDate(value, true) as Promise<PickState>;
}

_calcValue(value: string): string {
Expand Down

0 comments on commit 6c4d9d6

Please sign in to comment.