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

Method normalizeValue

packages/main/src/DateRangePicker.ts:421–428  ·  view source on GitHub ↗

* Extract both dates as timestamps, flip if necessary, and build (which will use the desired format so we enforce the format too) * @override

(value: string)

Source from the content-addressed store, hash-verified

419 * @override
420 */
421 normalizeValue(value: string) {
422 const firstDateTimestamp = this._extractFirstTimestamp(value);
423 const lastDateTimestamp = this._extractLastTimestamp(value);
424 if (firstDateTimestamp && lastDateTimestamp && firstDateTimestamp > lastDateTimestamp) { // if both are timestamps (not undefined), flip if necessary
425 return this._buildValue(lastDateTimestamp, firstDateTimestamp);
426 }
427 return this._buildValue(firstDateTimestamp, lastDateTimestamp);
428 }
429
430 /**
431 * The parser understands many formats, but we need one format

Callers

nothing calls this directly

Calls 3

_extractLastTimestampMethod · 0.95
_buildValueMethod · 0.95

Tested by

no test coverage detected