@dereekb/dbx-form 10.1.15 → 10.1.16

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.
@@ -3696,6 +3696,10 @@ var DbxDateTimeValueMode;
3696
3696
  * Value is returned/parsed as a minute of the day, relative to the current timezone.
3697
3697
  */
3698
3698
  DbxDateTimeValueMode[DbxDateTimeValueMode["MINUTE_OF_DAY"] = 4] = "MINUTE_OF_DAY";
3699
+ /**
3700
+ * Value is returned/parsed as a minute of the day, relative to the system timezone.
3701
+ */
3702
+ DbxDateTimeValueMode[DbxDateTimeValueMode["SYSTEM_MINUTE_OF_DAY"] = 5] = "SYSTEM_MINUTE_OF_DAY";
3699
3703
  })(DbxDateTimeValueMode || (DbxDateTimeValueMode = {}));
3700
3704
  function dbxDateTimeInputValueParseFactory(mode, timezoneInstance) {
3701
3705
  let factory;
@@ -3719,6 +3723,7 @@ function dbxDateTimeInputValueParseFactory(mode, timezoneInstance) {
3719
3723
  };
3720
3724
  useTimezoneInstance = false; // day strings do not use timezones
3721
3725
  break;
3726
+ case DbxDateTimeValueMode.SYSTEM_MINUTE_OF_DAY:
3722
3727
  case DbxDateTimeValueMode.MINUTE_OF_DAY:
3723
3728
  factory = (x) => {
3724
3729
  let result;
@@ -3735,6 +3740,9 @@ function dbxDateTimeInputValueParseFactory(mode, timezoneInstance) {
3735
3740
  }
3736
3741
  return result;
3737
3742
  };
3743
+ if (mode === DbxDateTimeValueMode.SYSTEM_MINUTE_OF_DAY) {
3744
+ useTimezoneInstance = false;
3745
+ }
3738
3746
  break;
3739
3747
  case DbxDateTimeValueMode.UNIX_TIMESTAMP:
3740
3748
  case DbxDateTimeValueMode.DATE_STRING:
@@ -3767,8 +3775,12 @@ function dbxDateTimeOutputValueFactory(mode, timezoneInstance) {
3767
3775
  case DbxDateTimeValueMode.UNIX_TIMESTAMP:
3768
3776
  factory = (x) => (x != null ? x.getTime() : x);
3769
3777
  break;
3778
+ case DbxDateTimeValueMode.SYSTEM_MINUTE_OF_DAY:
3770
3779
  case DbxDateTimeValueMode.MINUTE_OF_DAY:
3771
3780
  factory = (x) => (x != null ? dateToMinuteOfDay(x) : x);
3781
+ if (mode === DbxDateTimeValueMode.SYSTEM_MINUTE_OF_DAY) {
3782
+ useTimezoneInstance = false;
3783
+ }
3772
3784
  break;
3773
3785
  case DbxDateTimeValueMode.DATE:
3774
3786
  default:
@@ -3962,7 +3974,7 @@ class DbxDateTimeFieldComponent extends FieldType$1 {
3962
3974
  this.showAddTime$ = this.showTimeInput$.pipe(map((x) => !x && this.timeMode === DbxDateTimeFieldTimeMode.OPTIONAL), shareReplay(1));
3963
3975
  this.currentDate$ = this.dateInputCtrl.valueChanges.pipe(startWith(this.dateInputCtrl.value), shareReplay(1));
3964
3976
  this.date$ = this.currentDate$.pipe(filterMaybe(), shareReplay(1));
3965
- this.timezoneAbbreviation$ = combineLatest([this.date$, this.timezone$, this.timeDate$]).pipe(map(([date, timezone, timeDate]) => getTimezoneAbbreviation(timezone, timeDate ?? date)), distinctUntilChanged(), shareReplay(1));
3977
+ this.timezoneAbbreviation$ = combineLatest([this.currentDate$, this.timezone$, this.timeDate$]).pipe(map(([date, timezone, timeDate]) => getTimezoneAbbreviation(timezone, timeDate ?? date ?? new Date())), distinctUntilChanged(), shareReplay(1));
3966
3978
  this.dateValue$ = merge(this.date$, this.valueInSystemTimezone$.pipe(skipFirstMaybe())).pipe(map((x) => (x ? startOfDay(x) : null)), distinctUntilChanged(isSameDateDay), shareReplay(1));
3967
3979
  this.timeInput$ = this._updateTime.pipe(debounceTime(5), map(() => this.timeInputCtrl.value || ''), distinctUntilChanged());
3968
3980
  this.syncConfigObs$ = this._syncConfigObs.pipe(switchMapMaybeDefault(), shareReplay(1));
@@ -5018,6 +5030,7 @@ function dateTimeRangeField(inputConfig = {}) {
5018
5030
  required,
5019
5031
  timeMode: DbxDateTimeFieldTimeMode.REQUIRED,
5020
5032
  getSyncFieldsObs: undefined,
5033
+ valueMode,
5021
5034
  timeOnly: true,
5022
5035
  hideDateHint: true
5023
5036
  };