Skip to content

fix(ui5-dynamic-date-range): prevent DateTimeRange.isValidString from throwing on invalid input - #14327

Draft
unazko wants to merge 1 commit into
mainfrom
ddr-datetimerange-isvalidstring-fix
Draft

unazko wants to merge 1 commit into
mainfrom
ddr-datetimerange-isvalidstring-fix

Conversation

@unazko

@unazko unazko commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Issue
DateTimeRange.isValidString split the value on "-" and called .trim() on both parts without verifying they exist, throwing "Cannot read properties of undefined (reading 'trim')" for any string lacking the delimiter. Because the control validates a typed value against every registered option, this uncaught error broke value submission for all options whenever the DateTimeRange option was registered.

Solution
Guard against a missing value and missing delimiter parts, returning false for unparseable strings so validation never throws.

… throwing on invalid input

**Issue**
DateTimeRange.isValidString split the value on "-" and called .trim() on both
parts without verifying they exist, throwing "Cannot read properties of
undefined (reading 'trim')" for any string lacking the delimiter. Because the
control validates a typed value against every registered option, this uncaught
error broke value submission for all options whenever the DateTimeRange option
was registered.

**Solution**
Guard against a missing value and missing delimiter parts, returning false for
unparseable strings so validation never throws.
@unazko
unazko deployed to netlify-preview November 27, 2026 18:26 — with GitHub Actions Active
@sap-ui5-webcomponents-release

Copy link
Copy Markdown

This branch was successfully deployed

1 active deployment
netlify-preview — 4980d27c Deployed Nov 27, 2026 by unazko via deploy-preview #3870
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant