MCPcopy Create free account
hub / github.com/UI5/webcomponents / isValidValue

Method isValidValue

packages/main/src/DateRangePicker.ts:369–377  ·  view source on GitHub ↗

* Checks if a value is valid against the current date format of the DatePicker. * @public * @param value A value to be tested against the current date format

(value: string)

Source from the content-addressed store, hash-verified

367 * @param value A value to be tested against the current date format
368 */
369 isValidValue(value: string): boolean {
370 const parts = this._splitValueByDelimiter(value).filter(str => str.trim() !== "");
371
372 if (parts.some(dateString => this._isRelativeValue(dateString, this.getValueFormat()))) {
373 return false;
374 }
375
376 return parts.length <= 2 && parts.every(dateString => super.isValidValue(dateString)); // must be at most 2 dates and each must be valid
377 }
378
379 /**
380 * Checks if a value is valid against the current date format of the DatePicker.

Callers 1

formValidityMethod · 0.95

Calls 3

_isRelativeValueMethod · 0.95
getValueFormatMethod · 0.45

Tested by

no test coverage detected