@mediusinc/mng-commons 5.4.0-rc.4 → 5.4.0-rc.5

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.
@@ -4688,10 +4688,30 @@ class FormlyFieldDatepickerComponent extends ACommonsFormlyFieldType {
4688
4688
  noMillis: !this.dateTimeWithMillis,
4689
4689
  noTimezone: this.descriptor.datePickerValueNoTimezone ?? !this.dateTimeWithTimezone
4690
4690
  };
4691
+ let dateValue;
4692
+ if (typeof value === 'string' || typeof value === 'number') {
4693
+ dateValue = new Date(value);
4694
+ }
4695
+ else {
4696
+ dateValue = value;
4697
+ }
4698
+ if (dateValue !== null && dateValue !== undefined) {
4699
+ if (this.descriptor.datePickerShowTime) {
4700
+ if (this.descriptor.datePickerShowSeconds) {
4701
+ dateValue.setMilliseconds(0);
4702
+ }
4703
+ else {
4704
+ dateValue.setSeconds(0, 0);
4705
+ }
4706
+ }
4707
+ else {
4708
+ dateValue.setHours(0, 0, 0, 0);
4709
+ }
4710
+ }
4691
4711
  if (!this.descriptor.datePickerValueAsDateObj) {
4692
- return dateToIsoString(value, convertDateType, convertDateTimeOpts);
4712
+ return dateToIsoString(dateValue, convertDateType, convertDateTimeOpts);
4693
4713
  }
4694
- return value;
4714
+ return dateValue;
4695
4715
  }
4696
4716
  areDateValuesEqual(val1, val2) {
4697
4717
  const date1 = this.convertDateValue(val1);