@ngx-smz/core 21.0.0 → 21.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1352,7 +1352,15 @@ const CONTROL_FUNCTIONS = {
|
|
|
1352
1352
|
[SmzControlType.CALENDAR]: {
|
|
1353
1353
|
initialize: (input) => { },
|
|
1354
1354
|
clear: (control) => { control.patchValue(''); },
|
|
1355
|
-
applyDefaultValue: (control, input) => {
|
|
1355
|
+
applyDefaultValue: (control, input) => {
|
|
1356
|
+
const rawValue = input.defaultValue;
|
|
1357
|
+
if (rawValue == null) {
|
|
1358
|
+
control.patchValue(null);
|
|
1359
|
+
return;
|
|
1360
|
+
}
|
|
1361
|
+
const valueAsDate = rawValue instanceof Date ? rawValue : new Date(rawValue);
|
|
1362
|
+
control.patchValue(valueAsDate);
|
|
1363
|
+
},
|
|
1356
1364
|
getValue: (form, input, flattenResponse) => {
|
|
1357
1365
|
const value = form.get(input.propertyName).value;
|
|
1358
1366
|
if (!isEmpty$1(value) && !input.showTime && value instanceof Date) {
|