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

Method isValid

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

352 * @param value A value to be tested against the current date format
353 */
354 isValid(value: string): boolean {
355 const parts = this._splitValueByDelimiter(value).filter(str => str.trim() !== "");
356
357 if (parts.some(dateString => this._isRelativeValue(dateString, this.getFormat()))) {
358 return false;
359 }
360
361 return parts.length <= 2 && parts.every(dateString => super.isValid(dateString)); // must be at most 2 dates and each must be valid
362 }
363
364 /**
365 * Checks if a value is valid against the current date format of the DatePicker.

Callers

nothing calls this directly

Calls 3

_isRelativeValueMethod · 0.95
getFormatMethod · 0.45

Tested by

no test coverage detected