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

Method isValidDisplayValue

packages/main/src/DateRangePicker.ts:384–392  ·  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

382 * @param value A value to be tested against the current date format
383 */
384 isValidDisplayValue(value: string): boolean {
385 const parts = this._splitValueByDelimiter(value).filter(str => str.trim() !== "");
386
387 if (parts.some(dateString => this._isRelativeValue(dateString, this.getDisplayFormat()))) {
388 return false;
389 }
390
391 return parts.length <= 2 && parts.every(dateString => super.isValidDisplayValue(dateString)); // must be at most 2 dates and each must be valid
392 }
393
394 /**
395 * Checks if a date is between the minimum and maximum date.

Callers

nothing calls this directly

Calls 3

_isRelativeValueMethod · 0.95
getDisplayFormatMethod · 0.45

Tested by

no test coverage detected