@descope/web-components-ui 1.114.0 → 1.116.0

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.
@@ -8273,11 +8273,17 @@ const ComboBoxMixin = (superclass) =>
8273
8273
  return {};
8274
8274
  };
8275
8275
 
8276
- this.setComboBoxDescriptor();
8277
- this.#overrideOverlaySettings();
8278
8276
  this.#overrideRenderer();
8279
8277
  this.#disableDataProviderFilterEventIfNeeded();
8280
8278
 
8279
+ // This is a workaround for a problem we have in Console App, where in ScreenBuilder - the inputElement is not ready when trying to
8280
+ // set the component's descriptor and override the overlay settings.
8281
+ // THIS IS A PROBLEM WITH THE CONSOLE APP THAT NEEDS TO BE RESOLVED. Until then, we use this workaround.
8282
+ setTimeout(() => {
8283
+ this.setComboBoxDescriptor();
8284
+ this.#overrideOverlaySettings();
8285
+ });
8286
+
8281
8287
  // Set up observers - order matters here since renderItems can clear innerHTML
8282
8288
  observeAttributes(this, this.renderItems.bind(this), {
8283
8289
  includeAttrs: ['data'],
@@ -13444,10 +13450,6 @@ const multiSelectComboBoxMixin = (superclass) =>
13444
13450
 
13445
13451
  this.setGetValidity();
13446
13452
 
13447
- this.setComboBoxDescriptor();
13448
-
13449
- this.#overrideOverlaySettings();
13450
-
13451
13453
  this.#handleCustomValues();
13452
13454
 
13453
13455
  this.renderItems();
@@ -13460,6 +13462,14 @@ const multiSelectComboBoxMixin = (superclass) =>
13460
13462
  // tries to override it, causing us to lose the user set placeholder.
13461
13463
  forwardAttrs$1(this, this.baseElement, { includeAttrs: ['placeholder'] });
13462
13464
 
13465
+ // This is a workaround for a problem we have in Console App, where in ScreenBuilder - the inputElement is not ready when trying to
13466
+ // set the component's descriptor and override the overlay settings.
13467
+ // THIS IS A PROBLEM WITH THE CONSOLE APP THAT NEEDS TO BE RESOLVED. Until then, we use this workaround.
13468
+ setTimeout(() => {
13469
+ this.setComboBoxDescriptor();
13470
+ this.#overrideOverlaySettings();
13471
+ });
13472
+
13463
13473
  this.setDefaultValues();
13464
13474
 
13465
13475
  this.baseElement.addEventListener('selected-items-changed', () => {
@@ -15930,20 +15940,20 @@ const createFormat = (format) => {
15930
15940
 
15931
15941
  const formats = Object.fromEntries(SUPPORTED_FORMATS.map((f) => [f, createFormat(f)]));
15932
15942
 
15933
- const isValidTimestamp = (val) => !Number.isNaN(Number(val));
15943
+ const isValidEpoch = (val) => !Number.isNaN(Number(val));
15934
15944
 
15935
15945
  const isNumber = (val) => !!String(val || '').trim() && !Number.isNaN(Number(val));
15936
15946
 
15937
- const getTimestampParts = (timestamp) => {
15938
- const date = newDate(timestamp);
15947
+ const getPartsFromEpoch = (epoch) => {
15948
+ const date = newDate(epoch);
15939
15949
  const year = date.getFullYear();
15940
15950
  const month = date.getMonth() + 1;
15941
15951
  const day = date.getDate();
15942
15952
  return [year, month, day];
15943
15953
  };
15944
15954
 
15945
- const formatTimestamp = (timestamp, format) => {
15946
- const [year, month, day] = getTimestampParts(timestamp);
15955
+ const formatEpoch = (epoch, format) => {
15956
+ const [year, month, day] = getPartsFromEpoch(epoch);
15947
15957
 
15948
15958
  const parts = {
15949
15959
  DD: String(day).padStart(2, '0'),
@@ -15966,8 +15976,8 @@ const newDate = (date) => {
15966
15976
  };
15967
15977
 
15968
15978
  const getCurrentTime = () => newDate().getTime();
15969
- const getFullYear = (timestamp) => newDate(timestamp).getFullYear().toString();
15970
- const getMonth = (timestamp) => (newDate(timestamp).getMonth() + 1).toString();
15979
+ const getFullYear = (epoch) => newDate(epoch).getFullYear().toString();
15980
+ const getMonth = (epoch) => (newDate(epoch).getMonth() + 1).toString();
15971
15981
  const getCurrentDay = () => newDate().getDate();
15972
15982
 
15973
15983
  // Vaadin uses "constructed stylesheet" to hide the host in dialog components.
@@ -15985,6 +15995,13 @@ const parseDateString = (val, format) => {
15985
15995
  return formats[format].getDate(trimmed);
15986
15996
  };
15987
15997
 
15998
+ const dateToEpoch = (date, isUtc) => {
15999
+ if (isUtc) {
16000
+ return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate())).getTime();
16001
+ }
16002
+ return date.getTime();
16003
+ };
16004
+
15988
16005
  const calendarIcon = `
15989
16006
  <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
15990
16007
  <path fill-rule="evenodd" clip-rule="evenodd" d="M9 5H15V4.50468C15 4.21404 15.226 4 15.5047 4H16.4953C16.786 4 17 4.22595 17 4.50468V5H18.7568C19.3028 5 19.75 5.44725 19.75 5.99896V7.00104C19.75 7.55734 19.3053 8 18.7568 8H5.24317C4.69717 8 4.25 7.55275 4.25 7.00104V5.99896C4.25 5.44266 4.69466 5 5.24317 5H7V4.50468C7 4.21404 7.22596 4 7.50468 4H8.49532C8.78596 4 9 4.22595 9 4.50468V5ZM5.50468 9H6.49532C6.78596 9 7 9.22596 7 9.50468V10.4953C7 10.786 6.77404 11 6.49532 11H5.50468C5.21404 11 5 10.774 5 10.4953V9.50468C5 9.21404 5.22595 9 5.50468 9ZM8.50468 9H9.49532C9.78596 9 10 9.22596 10 9.50468V10.4953C10 10.786 9.77404 11 9.49532 11H8.50468C8.21404 11 8 10.774 8 10.4953V9.50468C8 9.21404 8.22596 9 8.50468 9ZM11.5047 9H12.4953C12.786 9 13 9.22596 13 9.50468V10.4953C13 10.786 12.774 11 12.4953 11H11.5047C11.214 11 11 10.774 11 10.4953V9.50468C11 9.21404 11.226 9 11.5047 9ZM5.50468 12H6.49532C6.78596 12 7 12.226 7 12.5047V13.4953C7 13.786 6.77404 14 6.49532 14H5.50468C5.21404 14 5 13.774 5 13.4953V12.5047C5 12.214 5.22595 12 5.50468 12ZM8.50468 12H9.49532C9.78596 12 10 12.226 10 12.5047V13.4953C10 13.786 9.77404 14 9.49532 14H8.50468C8.21404 14 8 13.774 8 13.4953V12.5047C8 12.214 8.22596 12 8.50468 12ZM11.5047 12H12.4953C12.786 12 13 12.226 13 12.5047V13.4953C13 13.786 12.774 14 12.4953 14H11.5047C11.214 14 11 13.774 11 13.4953V12.5047C11 12.214 11.226 12 11.5047 12ZM5.50468 15H6.49532C6.78596 15 7 15.226 7 15.5047V16.4953C7 16.786 6.77404 17 6.49532 17H5.50468C5.21404 17 5 16.774 5 16.4953V15.5047C5 15.214 5.22595 15 5.50468 15ZM8.50468 15H9.49532C9.78596 15 10 15.226 10 15.5047V16.4953C10 16.786 9.77404 17 9.49532 17H8.50468C8.21404 17 8 16.774 8 16.4953V15.5047C8 15.214 8.22596 15 8.50468 15ZM11.5047 15H12.4953C12.786 15 13 15.226 13 15.5047V16.4953C13 16.786 12.774 17 12.4953 17H11.5047C11.214 17 11 16.774 11 16.4953V15.5047C11 15.214 11.226 15 11.5047 15ZM14.5047 9H15.4953C15.786 9 16 9.22596 16 9.50468V10.4953C16 10.786 15.774 11 15.4953 11H14.5047C14.214 11 14 10.774 14 10.4953V9.50468C14 9.21404 14.226 9 14.5047 9ZM14.5047 12H15.4953C15.786 12 16 12.226 16 12.5047V13.4953C16 13.786 15.774 14 15.4953 14H14.5047C14.214 14 14 13.774 14 13.4953V12.5047C14 12.214 14.226 12 14.5047 12ZM14.5047 15H15.4953C15.786 15 16 15.226 16 15.5047V16.4953C16 16.786 15.774 17 15.4953 17H14.5047C14.214 17 14 16.774 14 16.4953V15.5047C14 15.214 14.226 15 14.5047 15ZM17.5047 15H18.4953C18.786 15 19 15.226 19 15.5047V16.4953C19 16.786 18.774 17 18.4953 17H17.5047C17.214 17 17 16.774 17 16.4953V15.5047C17 15.214 17.226 15 17.5047 15ZM5.50468 18H6.49532C6.78596 18 7 18.226 7 18.5047V19.4953C7 19.786 6.77404 20 6.49532 20H5.50468C5.21404 20 5 19.774 5 19.4953V18.5047C5 18.214 5.22595 18 5.50468 18ZM8.50468 18H9.49532C9.78596 18 10 18.226 10 18.5047V19.4953C10 19.786 9.77404 20 9.49532 20H8.50468C8.21404 20 8 19.774 8 19.4953V18.5047C8 18.214 8.22596 18 8.50468 18ZM11.5047 18H12.4953C12.786 18 13 18.226 13 18.5047V19.4953C13 19.786 12.774 20 12.4953 20H11.5047C11.214 20 11 19.774 11 19.4953V18.5047C11 18.214 11.226 18 11.5047 18ZM14.5047 18H15.4953C15.786 18 16 18.226 16 18.5047V19.4953C16 19.786 15.774 20 15.4953 20H14.5047C14.214 20 14 19.774 14 19.4953V18.5047C14 18.214 14.226 18 14.5047 18ZM17.5047 18H18.4953C18.786 18 19 18.226 19 18.5047V19.4953C19 19.786 18.774 20 18.4953 20H17.5047C17.214 20 17 19.774 17 19.4953V18.5047C17 18.214 17.226 18 17.5047 18ZM17.5047 12H18.4953C18.786 12 19 12.226 19 12.5047V13.4953C19 13.786 18.774 14 18.4953 14H17.5047C17.214 14 17 13.774 17 13.4953V12.5047C17 12.214 17.226 12 17.5047 12ZM17.5047 9H18.4953C18.786 9 19 9.22596 19 9.50468V10.4953C19 10.786 18.774 11 18.4953 11H17.5047C17.214 11 17 10.774 17 10.4953V9.50468C17 9.21404 17.226 9 17.5047 9Z" fill="#808080"/>
@@ -16090,9 +16107,9 @@ const getMonthsOptions = (customMonths = months) =>
16090
16107
  .map((item, index) => comboBoxItemTpl({ label: item, dataId: index + 1, dataName: item }))
16091
16108
  .join('');
16092
16109
 
16093
- const isViewVisible = (selectionTimestamp, previewTimestamp) => {
16094
- const [previewYear, previewMonth] = getTimestampParts(previewTimestamp);
16095
- const [selectedYear, selectedMonth] = getTimestampParts(selectionTimestamp);
16110
+ const isViewVisible = (selectionEpoch, previewEpoch) => {
16111
+ const [previewYear, previewMonth] = getPartsFromEpoch(previewEpoch);
16112
+ const [selectedYear, selectedMonth] = getPartsFromEpoch(selectionEpoch);
16096
16113
  return selectedYear === previewYear && selectedMonth === previewMonth;
16097
16114
  };
16098
16115
 
@@ -16143,8 +16160,8 @@ const ensureWeekdayNamesArr = (attrVal) => {
16143
16160
 
16144
16161
  const truncateWeekdays = (arr) => arr.map((d) => d.substring(0, 3));
16145
16162
 
16146
- const prevMonth = (timestamp) => {
16147
- const date = newDate(timestamp);
16163
+ const prevMonth = (epoch) => {
16164
+ const date = newDate(epoch);
16148
16165
  const month = date.getMonth();
16149
16166
 
16150
16167
  if (month === 0) {
@@ -16158,8 +16175,8 @@ const prevMonth = (timestamp) => {
16158
16175
  return date;
16159
16176
  };
16160
16177
 
16161
- const nextMonth = (timestamp) => {
16162
- const date = newDate(timestamp);
16178
+ const nextMonth = (epoch) => {
16179
+ const date = newDate(epoch);
16163
16180
  const month = date.getMonth();
16164
16181
 
16165
16182
  if (month === 11) {
@@ -16197,11 +16214,11 @@ class RawCalendar extends BaseInputClass$3 {
16197
16214
  return [].concat(BaseInputClass$3.observedAttributes || [], observedAttrs$2, calendarUiAttrs);
16198
16215
  }
16199
16216
 
16200
- // preview state timestamp
16217
+ // preview state epoch
16201
16218
  preview;
16202
16219
 
16203
- // value timestamp
16204
- timestamp;
16220
+ // value epoch
16221
+ epoch;
16205
16222
 
16206
16223
  constructor() {
16207
16224
  super();
@@ -16287,23 +16304,23 @@ class RawCalendar extends BaseInputClass$3 {
16287
16304
  set value(val) {
16288
16305
  if (!val) return;
16289
16306
 
16290
- const timestamp = newDate(val).getTime();
16307
+ const epoch = newDate(val).getTime();
16291
16308
 
16292
- if (!isValidTimestamp(timestamp) || timestamp === this.timestmap) {
16309
+ if (!isValidEpoch(epoch) || epoch === this.epoch) {
16293
16310
  return;
16294
16311
  }
16295
16312
 
16296
- this.timestamp = timestamp;
16313
+ this.epoch = epoch;
16297
16314
 
16298
16315
  this.renderCalendar();
16299
16316
  }
16300
16317
 
16301
16318
  get value() {
16302
- return this.timestamp ? formatTimestamp(this.timestamp, NATIVE_FORMAT) : '';
16319
+ return this.epoch ? formatEpoch(this.epoch, NATIVE_FORMAT) : '';
16303
16320
  }
16304
16321
 
16305
16322
  get isSelectedView() {
16306
- return isViewVisible(this.preview, this.timestamp);
16323
+ return isViewVisible(this.preview, this.epoch);
16307
16324
  }
16308
16325
 
16309
16326
  get isTodayView() {
@@ -16420,14 +16437,14 @@ class RawCalendar extends BaseInputClass$3 {
16420
16437
  clearSelectedDay() {
16421
16438
  this.getSelectedDayEle()?.removeAttribute('data-selected');
16422
16439
  this.submitButton.setAttribute('disabled', 'true');
16423
- this.timestamp = '';
16440
+ this.epoch = '';
16424
16441
  }
16425
16442
 
16426
16443
  updateInputs() {
16427
16444
  if (this.yearInput && this.monthInput) {
16428
- const timestamp = this.preview || getCurrentTime();
16429
- const year = getFullYear(timestamp);
16430
- const month = getMonth(timestamp);
16445
+ const epoch = this.preview || getCurrentTime();
16446
+ const year = getFullYear(epoch);
16447
+ const month = getMonth(epoch);
16431
16448
  this.monthInput.value = month;
16432
16449
  // For the yearInput we update the base element directly to properly trigger the change event
16433
16450
  // since this can be a custom value
@@ -16439,9 +16456,9 @@ class RawCalendar extends BaseInputClass$3 {
16439
16456
 
16440
16457
  renderCalendar() {
16441
16458
  const date = newDate(this.preview || getCurrentTime());
16442
- const timestamp = date.getTime();
16459
+ const epoch = date.getTime();
16443
16460
 
16444
- const [year, month] = getTimestampParts(timestamp);
16461
+ const [year, month] = getPartsFromEpoch(epoch);
16445
16462
 
16446
16463
  if (this.calendar) {
16447
16464
  this.calendar.innerHTML = createMonthView(year, month, truncateWeekdays(this.weekdayNames));
@@ -16460,7 +16477,7 @@ class RawCalendar extends BaseInputClass$3 {
16460
16477
  if (this.isDisabled) return;
16461
16478
  const date = newDate(this.preview);
16462
16479
  date.setDate(Number(e.target.getAttribute('data-date-day')));
16463
- this.value = formatTimestamp(date.getTime(), NATIVE_FORMAT);
16480
+ this.value = formatEpoch(date.getTime(), NATIVE_FORMAT);
16464
16481
  this.dispatchEvent(new CustomEvent('day-changed', { detail: date }));
16465
16482
  }
16466
16483
 
@@ -16491,7 +16508,7 @@ class RawCalendar extends BaseInputClass$3 {
16491
16508
  }
16492
16509
 
16493
16510
  getSelectedDayEle() {
16494
- const day = newDate(this.timestamp).getDate();
16511
+ const day = newDate(this.epoch).getDate();
16495
16512
  return this.calendar?.querySelector(`[data-date-day="${day}"]`);
16496
16513
  }
16497
16514
 
@@ -16516,8 +16533,8 @@ class RawCalendar extends BaseInputClass$3 {
16516
16533
  if (this.isTodayView) {
16517
16534
  const ele = this.getCurrentDayEle();
16518
16535
  const title = this.getAttribute('calendar-label-today') || CALENDAR_LABEL_TODAY;
16519
- ele.setAttribute('data-current-day', 'true');
16520
- ele.setAttribute('title', title);
16536
+ ele?.setAttribute('data-current-day', 'true');
16537
+ ele?.setAttribute('title', title);
16521
16538
  }
16522
16539
  }
16523
16540
 
@@ -16540,7 +16557,7 @@ class RawCalendar extends BaseInputClass$3 {
16540
16557
  }
16541
16558
 
16542
16559
  clearValue() {
16543
- this.timestamp = '';
16560
+ this.epoch = '';
16544
16561
  this.value = '';
16545
16562
  this.removeAttribute('preview');
16546
16563
  this.submitButton.setAttribute('disabled', 'true');
@@ -16553,11 +16570,11 @@ class RawCalendar extends BaseInputClass$3 {
16553
16570
  }
16554
16571
 
16555
16572
  const date = newDate(newValue);
16556
- const timestamp = date.getTime();
16573
+ const epoch = date.getTime();
16557
16574
 
16558
- if (isValidTimestamp(timestamp)) {
16559
- this.timestamp = timestamp;
16560
- this.preview = timestamp;
16575
+ if (isValidEpoch(epoch)) {
16576
+ this.epoch = epoch;
16577
+ this.preview = epoch;
16561
16578
  } else {
16562
16579
  this.clearValue();
16563
16580
  }
@@ -17026,12 +17043,19 @@ const componentName$m = getComponentName$1('date-field');
17026
17043
  const BASE_SELECTOR = 'vaadin-popover';
17027
17044
  const BaseInputClass$2 = createBaseInputClass({ componentName: componentName$m, baseSelector: BASE_SELECTOR });
17028
17045
 
17029
- const dateFieldAttrs = ['format', 'opened', 'initial-value', 'readonly', 'disable-calendar'];
17046
+ const dateFieldAttrs = [
17047
+ 'format',
17048
+ 'opened',
17049
+ 'initial-value',
17050
+ 'readonly',
17051
+ 'disable-calendar',
17052
+ 'utc-time',
17053
+ ];
17030
17054
  const calendarAttrs = ['years-range', 'calendar-months', 'calendar-weekdays'];
17031
17055
  const observedAttrs$1 = [...dateFieldAttrs, ...calendarAttrs];
17032
17056
 
17033
17057
  class RawDateFieldClass extends BaseInputClass$2 {
17034
- timestamp = '';
17058
+ epoch = '';
17035
17059
 
17036
17060
  format = DEFAULT_FORMAT;
17037
17061
 
@@ -17043,10 +17067,10 @@ class RawDateFieldClass extends BaseInputClass$2 {
17043
17067
 
17044
17068
  updateValue() {
17045
17069
  if (this.isCountersOutOfRange) {
17046
- this.updateTimestamp('');
17070
+ this.updateEpoch('');
17047
17071
  } else {
17048
17072
  const date = formats[this.format].getDate(this.inputElement.value);
17049
- this.updateTimestamp(date.getTime());
17073
+ this.updateEpoch(dateToEpoch(date, this.isUtcTime));
17050
17074
  }
17051
17075
  }
17052
17076
 
@@ -17057,11 +17081,11 @@ class RawDateFieldClass extends BaseInputClass$2 {
17057
17081
  this.#dispatchInput();
17058
17082
  };
17059
17083
 
17060
- updateTimestamp(epochOrDate) {
17084
+ updateEpoch(epochOrDate) {
17061
17085
  if (!epochOrDate) {
17062
- this.timestamp = '';
17086
+ this.epoch = '';
17063
17087
  } else {
17064
- this.timestamp = newDate(epochOrDate).getTime();
17088
+ this.epoch = newDate(epochOrDate).getTime();
17065
17089
  }
17066
17090
  }
17067
17091
 
@@ -17134,11 +17158,11 @@ class RawDateFieldClass extends BaseInputClass$2 {
17134
17158
  return this.getAttribute('opened') === 'true';
17135
17159
  }
17136
17160
 
17137
- // returns the input's value as a timestamp
17161
+ // returns the input's value as a epoch
17138
17162
  get displayValueEpoch() {
17139
17163
  const date = formats[this.format].getDate(this.inputElement.value);
17140
17164
 
17141
- if (!isValidTimestamp(date?.getTime())) {
17165
+ if (!isValidEpoch(date?.getTime())) {
17142
17166
  return null;
17143
17167
  }
17144
17168
 
@@ -17186,15 +17210,15 @@ class RawDateFieldClass extends BaseInputClass$2 {
17186
17210
  if (this.isInvalidDate()) {
17187
17211
  return '';
17188
17212
  }
17189
- return this.timestamp;
17213
+ return this.epoch;
17190
17214
  }
17191
17215
 
17192
17216
  set value(val) {
17193
17217
  if (val) {
17194
- this.updateTimestamp(val);
17218
+ this.updateEpoch(val);
17195
17219
  this.updateDateCounters(newDate(val));
17196
17220
  } else {
17197
- this.updateTimestamp('');
17221
+ this.updateEpoch('');
17198
17222
  }
17199
17223
  }
17200
17224
 
@@ -17210,6 +17234,10 @@ class RawDateFieldClass extends BaseInputClass$2 {
17210
17234
  return this.getAttribute('disable-calendar') === 'true';
17211
17235
  }
17212
17236
 
17237
+ get isUtcTime() {
17238
+ return this.getAttribute('utc-time') === 'true';
17239
+ }
17240
+
17213
17241
  get isSelectAll() {
17214
17242
  const inputEle = this.inputElement.baseElement.inputElement;
17215
17243
  return inputEle.value.length === inputEle.selectionStart + inputEle.selectionEnd;
@@ -17224,7 +17252,7 @@ class RawDateFieldClass extends BaseInputClass$2 {
17224
17252
  }
17225
17253
 
17226
17254
  updateInputDisplay() {
17227
- this.inputElement.value = formatTimestamp(newDate(this.countersValue).getTime(), this.format);
17255
+ this.inputElement.value = formatEpoch(newDate(this.countersValue).getTime(), this.format);
17228
17256
  }
17229
17257
 
17230
17258
  init() {
@@ -17415,7 +17443,7 @@ class RawDateFieldClass extends BaseInputClass$2 {
17415
17443
 
17416
17444
  const calendarDate = newDate(this.calendar.value);
17417
17445
 
17418
- this.value = calendarDate.getTime();
17446
+ this.value = dateToEpoch(calendarDate, this.isUtcTime);
17419
17447
 
17420
17448
  this.getCounterById('year').replaceValue(calendarDate.getFullYear());
17421
17449
  this.getCounterById('month').replaceValue(calendarDate.getMonth() + 1);
@@ -17429,17 +17457,17 @@ class RawDateFieldClass extends BaseInputClass$2 {
17429
17457
 
17430
17458
  updateCalendarView() {
17431
17459
  const validInputVal =
17432
- isValidTimestamp(newDate(this.inputElement.value || '').getTime()) &&
17460
+ isValidEpoch(newDate(this.inputElement.value || '').getTime()) &&
17433
17461
  formats[this.format].validate(this.inputElement.value);
17434
17462
 
17435
17463
  if (this.displayValueEpoch || validInputVal) {
17436
17464
  this.calendar.setAttribute(
17437
17465
  'initial-value',
17438
- formatTimestamp(this.displayValueEpoch || this.timestamp, NATIVE_FORMAT)
17466
+ formatEpoch(this.displayValueEpoch || this.epoch, NATIVE_FORMAT)
17439
17467
  );
17440
17468
  } else {
17441
17469
  this.calendar.clearValue();
17442
- this.calendar.setAttribute('preview', formatTimestamp(getCurrentTime(), NATIVE_FORMAT));
17470
+ this.calendar.setAttribute('preview', formatEpoch(getCurrentTime(), NATIVE_FORMAT));
17443
17471
  }
17444
17472
 
17445
17473
  forwardAttrs$1(this, this.calendar, {
@@ -17755,12 +17783,22 @@ class RawDateFieldClass extends BaseInputClass$2 {
17755
17783
  year: '',
17756
17784
  };
17757
17785
 
17786
+ if (!this.epoch) {
17787
+ return ret;
17788
+ }
17789
+
17758
17790
  try {
17759
- const date = newDate(this.timestamp);
17791
+ const date = newDate(this.epoch);
17760
17792
 
17761
- ret.month = date.getMonth() + 1;
17762
- ret.day = date.getDate();
17763
- ret.year = date.getFullYear();
17793
+ if (this.isUtcTime) {
17794
+ ret.month = date.getUTCMonth() + 1;
17795
+ ret.day = date.getUTCDate();
17796
+ ret.year = date.getUTCFullYear();
17797
+ } else {
17798
+ ret.month = date.getMonth() + 1;
17799
+ ret.day = date.getDate();
17800
+ ret.year = date.getFullYear();
17801
+ }
17764
17802
  } catch (e) {}
17765
17803
 
17766
17804
  return ret;
@@ -17804,7 +17842,7 @@ class RawDateFieldClass extends BaseInputClass$2 {
17804
17842
  const validDate = parseDateString(pastedData, this.format);
17805
17843
 
17806
17844
  if (validDate) {
17807
- this.value = validDate.getTime();
17845
+ this.value = dateToEpoch(validDate, this.isUtcTime);
17808
17846
  this.onDateCounterChange();
17809
17847
 
17810
17848
  // select all