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

Method normalizeDisplayValue

packages/main/src/DatePicker.ts:837–843  ·  view source on GitHub ↗

* The parser understands many formats, but we need one format * @protected

(value: string)

Source from the content-addressed store, hash-verified

835 * @protected
836 */
837 normalizeDisplayValue(value: string) {
838 if (value === "" || !this.getDisplayFormat().parse(value, true)) {
839 return value;
840 }
841
842 return this.getDisplayFormat().format(this.getDisplayFormat().parse(value, true), true); // it is important to both parse and format the date as UTC
843 }
844
845 get _lastDayOfTheYear() {
846 const currentYear = UI5Date.getInstance().getFullYear();

Callers 1

Calls 3

parseMethod · 0.45
getDisplayFormatMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected