Conversation
There was a problem hiding this comment.
Code Review
This pull request simplifies the InputDateController by removing the DEFAULT_MAX_DATE constant and the logic that defaulted to it within validateMax. The feedback recommends updating the validateMax method signature to explicitly include null to maintain type safety and consistency now that values are passed directly to the validation function.
| public validateMax(value?: Iso8601 | Date): void { | ||
| const ensuredValue = | ||
| (value === undefined || value === null) && | ||
| (this.component._type === 'date' || this.component._type === 'month' || this.component._type === 'datetime-local') | ||
| ? InputDateController.DEFAULT_MAX_DATE | ||
| : value; | ||
|
|
||
| this.validateIso8601('_max', ensuredValue); | ||
| this.validateIso8601('_max', value); |
There was a problem hiding this comment.
The validateMax method signature should be updated to include null (i.e., value?: Iso8601 | Date | null). Since the internal null-check and default value assignment have been removed, null values are now passed directly to validateIso8601. Updating the signature ensures consistency with validateValue and correctly reflects that null is a valid input for unsetting the maximum date in TypeScript.
| public validateMax(value?: Iso8601 | Date): void { | |
| const ensuredValue = | |
| (value === undefined || value === null) && | |
| (this.component._type === 'date' || this.component._type === 'month' || this.component._type === 'datetime-local') | |
| ? InputDateController.DEFAULT_MAX_DATE | |
| : value; | |
| this.validateIso8601('_max', ensuredValue); | |
| this.validateIso8601('_max', value); | |
| public validateMax(value?: Iso8601 | Date | null): void { | |
| this.validateIso8601('_max', value); |
|
🚀 MCP preview deployed to Vercel: https://kolibri-ljlh7njkq-public-ui-kolibri-mcp.vercel.app |
|
Netlify Draft Deployment |
No description provided.