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

Method normalizeValue

packages/main/src/TimePicker.ts:921–937  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

919 }
920
921 normalizeValue(value: string) {
922 if (value === "") {
923 return value;
924 }
925
926 const parsedFromDisplay = this.getDisplayFormat().parse(value, true);
927 if (parsedFromDisplay) {
928 return this.getValueFormat().format(parsedFromDisplay, true);
929 }
930
931 const parsedFromValue = this.getValueFormat().parse(value, true);
932 if (parsedFromValue) {
933 return this.getValueFormat().format(parsedFromValue, true);
934 }
935
936 return value;
937 }
938
939 _modifyValueBy(amount: number, unit: string) {
940 const date = this.getValueFormat().parse(this._effectiveValue) as Date;

Callers 2

onBeforeRenderingMethod · 0.95

Calls 4

getDisplayFormatMethod · 0.95
getValueFormatMethod · 0.95
parseMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected