@vaadin/date-time-picker 24.5.1 → 24.5.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/date-time-picker",
3
- "version": "24.5.1",
3
+ "version": "24.5.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -36,18 +36,18 @@
36
36
  ],
37
37
  "dependencies": {
38
38
  "@polymer/polymer": "^3.0.0",
39
- "@vaadin/a11y-base": "~24.5.1",
40
- "@vaadin/component-base": "~24.5.1",
41
- "@vaadin/custom-field": "~24.5.1",
42
- "@vaadin/date-picker": "~24.5.1",
43
- "@vaadin/field-base": "~24.5.1",
44
- "@vaadin/time-picker": "~24.5.1",
45
- "@vaadin/vaadin-lumo-styles": "~24.5.1",
46
- "@vaadin/vaadin-material-styles": "~24.5.1",
47
- "@vaadin/vaadin-themable-mixin": "~24.5.1"
39
+ "@vaadin/a11y-base": "~24.5.2",
40
+ "@vaadin/component-base": "~24.5.2",
41
+ "@vaadin/custom-field": "~24.5.2",
42
+ "@vaadin/date-picker": "~24.5.2",
43
+ "@vaadin/field-base": "~24.5.2",
44
+ "@vaadin/time-picker": "~24.5.2",
45
+ "@vaadin/vaadin-lumo-styles": "~24.5.2",
46
+ "@vaadin/vaadin-material-styles": "~24.5.2",
47
+ "@vaadin/vaadin-themable-mixin": "~24.5.2"
48
48
  },
49
49
  "devDependencies": {
50
- "@vaadin/chai-plugins": "~24.5.1",
50
+ "@vaadin/chai-plugins": "~24.5.2",
51
51
  "@vaadin/testing-helpers": "^1.0.0",
52
52
  "sinon": "^18.0.0"
53
53
  },
@@ -55,5 +55,5 @@
55
55
  "web-types.json",
56
56
  "web-types.lit.json"
57
57
  ],
58
- "gitHead": "0cf89edf4f22ee6f71925b86ea38d22f118638c3"
58
+ "gitHead": "3e07e97ed0bf355373d1ef0216a3954113e4a40f"
59
59
  }
@@ -11,7 +11,12 @@ import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
11
11
  import { SlotController } from '@vaadin/component-base/src/slot-controller.js';
12
12
  import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
13
13
  import { DatePicker } from '@vaadin/date-picker/src/vaadin-date-picker.js';
14
- import { dateEquals, parseDate } from '@vaadin/date-picker/src/vaadin-date-picker-helper.js';
14
+ import {
15
+ dateEquals,
16
+ formatUTCISODate,
17
+ normalizeUTCDate,
18
+ parseUTCDate,
19
+ } from '@vaadin/date-picker/src/vaadin-date-picker-helper.js';
15
20
  import { FieldMixin } from '@vaadin/field-base/src/field-mixin.js';
16
21
  import { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';
17
22
  import { TimePicker } from '@vaadin/time-picker/src/vaadin-time-picker.js';
@@ -624,16 +629,16 @@ class DateTimePicker extends FieldMixin(DisabledMixin(FocusMixin(ThemableMixin(E
624
629
  __updateTimePickerMinMax() {
625
630
  if (this.__timePicker && this.__datePicker) {
626
631
  const selectedDate = this.__parseDate(this.__datePicker.value);
627
- const isMinMaxSameDay = dateEquals(this.__minDateTime, this.__maxDateTime);
632
+ const isMinMaxSameDay = dateEquals(this.__minDateTime, this.__maxDateTime, normalizeUTCDate);
628
633
  const oldTimeValue = this.__timePicker.value;
629
634
 
630
- if ((this.__minDateTime && dateEquals(selectedDate, this.__minDateTime)) || isMinMaxSameDay) {
635
+ if ((this.__minDateTime && dateEquals(selectedDate, this.__minDateTime, normalizeUTCDate)) || isMinMaxSameDay) {
631
636
  this.__timePicker.min = this.__dateToIsoTimeString(this.__minDateTime);
632
637
  } else {
633
638
  this.__timePicker.min = this.__defaultTimeMinValue;
634
639
  }
635
640
 
636
- if ((this.__maxDateTime && dateEquals(selectedDate, this.__maxDateTime)) || isMinMaxSameDay) {
641
+ if ((this.__maxDateTime && dateEquals(selectedDate, this.__maxDateTime, normalizeUTCDate)) || isMinMaxSameDay) {
637
642
  this.__timePicker.max = this.__dateToIsoTimeString(this.__maxDateTime);
638
643
  } else {
639
644
  this.__timePicker.max = this.__defaultTimeMaxValue;
@@ -759,7 +764,7 @@ class DateTimePicker extends FieldMixin(DisabledMixin(FocusMixin(ThemableMixin(E
759
764
  * @private
760
765
  */
761
766
  __parseDate(str) {
762
- return parseDate(str);
767
+ return parseUTCDate(str);
763
768
  }
764
769
 
765
770
  /**
@@ -773,7 +778,7 @@ class DateTimePicker extends FieldMixin(DisabledMixin(FocusMixin(ThemableMixin(E
773
778
  if (!date) {
774
779
  return defaultValue;
775
780
  }
776
- return DatePicker.prototype._formatISO(date);
781
+ return formatUTCISODate(date);
777
782
  }
778
783
 
779
784
  /**
@@ -820,10 +825,10 @@ class DateTimePicker extends FieldMixin(DisabledMixin(FocusMixin(ThemableMixin(E
820
825
  return;
821
826
  }
822
827
 
823
- date.setHours(parseInt(time.hours));
824
- date.setMinutes(parseInt(time.minutes || 0));
825
- date.setSeconds(parseInt(time.seconds || 0));
826
- date.setMilliseconds(parseInt(time.milliseconds || 0));
828
+ date.setUTCHours(parseInt(time.hours));
829
+ date.setUTCMinutes(parseInt(time.minutes || 0));
830
+ date.setUTCSeconds(parseInt(time.seconds || 0));
831
+ date.setUTCMilliseconds(parseInt(time.milliseconds || 0));
827
832
 
828
833
  return date;
829
834
  }
@@ -853,10 +858,10 @@ class DateTimePicker extends FieldMixin(DisabledMixin(FocusMixin(ThemableMixin(E
853
858
  __dateToIsoTimeString(date) {
854
859
  return this.__formatTimeISO(
855
860
  this.__validateTime({
856
- hours: date.getHours(),
857
- minutes: date.getMinutes(),
858
- seconds: date.getSeconds(),
859
- milliseconds: date.getMilliseconds(),
861
+ hours: date.getUTCHours(),
862
+ minutes: date.getUTCMinutes(),
863
+ seconds: date.getUTCSeconds(),
864
+ milliseconds: date.getUTCMilliseconds(),
860
865
  }),
861
866
  );
862
867
  }
@@ -917,14 +922,14 @@ class DateTimePicker extends FieldMixin(DisabledMixin(FocusMixin(ThemableMixin(E
917
922
  * @private
918
923
  */
919
924
  __dateTimeEquals(date1, date2) {
920
- if (!dateEquals(date1, date2)) {
925
+ if (!dateEquals(date1, date2, normalizeUTCDate)) {
921
926
  return false;
922
927
  }
923
928
  return (
924
- date1.getHours() === date2.getHours() &&
925
- date1.getMinutes() === date2.getMinutes() &&
926
- date1.getSeconds() === date2.getSeconds() &&
927
- date1.getMilliseconds() === date2.getMilliseconds()
929
+ date1.getUTCHours() === date2.getUTCHours() &&
930
+ date1.getUTCMinutes() === date2.getUTCMinutes() &&
931
+ date1.getUTCSeconds() === date2.getUTCSeconds() &&
932
+ date1.getUTCMilliseconds() === date2.getUTCMilliseconds()
928
933
  );
929
934
  }
930
935
 
package/web-types.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/date-time-picker",
4
- "version": "24.5.1",
4
+ "version": "24.5.2",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "elements": [
9
9
  {
10
10
  "name": "vaadin-date-time-picker",
11
- "description": "`<vaadin-date-time-picker>` is a Web Component providing a date time selection field.\n\n```html\n<vaadin-date-time-picker value=\"2019-09-16T15:00\"></vaadin-date-time-picker>\n```\n```js\ndateTimePicker.value = '2019-09-16T15:00';\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The slotted label element wrapper\n`helper-text` | The slotted helper text element wrapper\n`error-message` | The slotted error message element wrapper\n`required-indicator` | The `required` state indicator element\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n--------------------|-------------------------------------------|------------\n`disabled` | Set when the element is disabled | :host\n`focused` | Set when the element is focused | :host\n`focus-ring` | Set when the element is keyboard focused | :host\n`readonly` | Set when the element is readonly | :host\n`invalid` | Set when the element is invalid | :host\n`has-label` | Set when the element has a label | :host\n`has-value` | Set when the element has a value | :host\n`has-helper` | Set when the element has helper text | :host\n`has-error-message` | Set when the element has an error message | :host\n\n### Internal components\n\nThe following components are created by `<vaadin-date-time-picker>` and placed in light DOM:\n\n- [`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.5.1/#/elements/vaadin-date-picker).\n- [`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.5.1/#/elements/vaadin-time-picker).\n\nNote: the `theme` attribute value set on `<vaadin-date-time-picker>` is\npropagated to these components.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
11
+ "description": "`<vaadin-date-time-picker>` is a Web Component providing a date time selection field.\n\n```html\n<vaadin-date-time-picker value=\"2019-09-16T15:00\"></vaadin-date-time-picker>\n```\n```js\ndateTimePicker.value = '2019-09-16T15:00';\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The slotted label element wrapper\n`helper-text` | The slotted helper text element wrapper\n`error-message` | The slotted error message element wrapper\n`required-indicator` | The `required` state indicator element\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n--------------------|-------------------------------------------|------------\n`disabled` | Set when the element is disabled | :host\n`focused` | Set when the element is focused | :host\n`focus-ring` | Set when the element is keyboard focused | :host\n`readonly` | Set when the element is readonly | :host\n`invalid` | Set when the element is invalid | :host\n`has-label` | Set when the element has a label | :host\n`has-value` | Set when the element has a value | :host\n`has-helper` | Set when the element has helper text | :host\n`has-error-message` | Set when the element has an error message | :host\n\n### Internal components\n\nThe following components are created by `<vaadin-date-time-picker>` and placed in light DOM:\n\n- [`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.5.2/#/elements/vaadin-date-picker).\n- [`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.5.2/#/elements/vaadin-time-picker).\n\nNote: the `theme` attribute value set on `<vaadin-date-time-picker>` is\npropagated to these components.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
12
12
  "attributes": [
13
13
  {
14
14
  "name": "disabled",
@@ -224,7 +224,7 @@
224
224
  },
225
225
  {
226
226
  "name": "overlay-class",
227
- "description": "A space-delimited list of CSS class names to set on the overlay elements\nof the internal components controlled by the `<vaadin-date-time-picker>`:\n\n- [`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.5.1/#/elements/vaadin-date-picker#property-overlayClass)\n- [`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.5.1/#/elements/vaadin-time-picker#property-overlayClass)",
227
+ "description": "A space-delimited list of CSS class names to set on the overlay elements\nof the internal components controlled by the `<vaadin-date-time-picker>`:\n\n- [`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.5.2/#/elements/vaadin-date-picker#property-overlayClass)\n- [`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.5.2/#/elements/vaadin-time-picker#property-overlayClass)",
228
228
  "value": {
229
229
  "type": [
230
230
  "string",
@@ -461,7 +461,7 @@
461
461
  },
462
462
  {
463
463
  "name": "i18n",
464
- "description": "The object used to localize this component.\nTo change the default localization, replace the entire\n`i18n` object or just the properties you want to modify.\n\nThe object is a combination of the i18n properties supported by\n[`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.5.1/#/elements/vaadin-date-picker) and\n[`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.5.1/#/elements/vaadin-time-picker).",
464
+ "description": "The object used to localize this component.\nTo change the default localization, replace the entire\n`i18n` object or just the properties you want to modify.\n\nThe object is a combination of the i18n properties supported by\n[`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.5.2/#/elements/vaadin-date-picker) and\n[`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.5.2/#/elements/vaadin-time-picker).",
465
465
  "value": {
466
466
  "type": [
467
467
  "DateTimePickerI18n"
@@ -470,7 +470,7 @@
470
470
  },
471
471
  {
472
472
  "name": "overlayClass",
473
- "description": "A space-delimited list of CSS class names to set on the overlay elements\nof the internal components controlled by the `<vaadin-date-time-picker>`:\n\n- [`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.5.1/#/elements/vaadin-date-picker#property-overlayClass)\n- [`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.5.1/#/elements/vaadin-time-picker#property-overlayClass)",
473
+ "description": "A space-delimited list of CSS class names to set on the overlay elements\nof the internal components controlled by the `<vaadin-date-time-picker>`:\n\n- [`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.5.2/#/elements/vaadin-date-picker#property-overlayClass)\n- [`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.5.2/#/elements/vaadin-time-picker#property-overlayClass)",
474
474
  "value": {
475
475
  "type": [
476
476
  "string",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/date-time-picker",
4
- "version": "24.5.1",
4
+ "version": "24.5.2",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -16,7 +16,7 @@
16
16
  "elements": [
17
17
  {
18
18
  "name": "vaadin-date-time-picker",
19
- "description": "`<vaadin-date-time-picker>` is a Web Component providing a date time selection field.\n\n```html\n<vaadin-date-time-picker value=\"2019-09-16T15:00\"></vaadin-date-time-picker>\n```\n```js\ndateTimePicker.value = '2019-09-16T15:00';\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The slotted label element wrapper\n`helper-text` | The slotted helper text element wrapper\n`error-message` | The slotted error message element wrapper\n`required-indicator` | The `required` state indicator element\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n--------------------|-------------------------------------------|------------\n`disabled` | Set when the element is disabled | :host\n`focused` | Set when the element is focused | :host\n`focus-ring` | Set when the element is keyboard focused | :host\n`readonly` | Set when the element is readonly | :host\n`invalid` | Set when the element is invalid | :host\n`has-label` | Set when the element has a label | :host\n`has-value` | Set when the element has a value | :host\n`has-helper` | Set when the element has helper text | :host\n`has-error-message` | Set when the element has an error message | :host\n\n### Internal components\n\nThe following components are created by `<vaadin-date-time-picker>` and placed in light DOM:\n\n- [`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.5.1/#/elements/vaadin-date-picker).\n- [`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.5.1/#/elements/vaadin-time-picker).\n\nNote: the `theme` attribute value set on `<vaadin-date-time-picker>` is\npropagated to these components.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
19
+ "description": "`<vaadin-date-time-picker>` is a Web Component providing a date time selection field.\n\n```html\n<vaadin-date-time-picker value=\"2019-09-16T15:00\"></vaadin-date-time-picker>\n```\n```js\ndateTimePicker.value = '2019-09-16T15:00';\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The slotted label element wrapper\n`helper-text` | The slotted helper text element wrapper\n`error-message` | The slotted error message element wrapper\n`required-indicator` | The `required` state indicator element\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n--------------------|-------------------------------------------|------------\n`disabled` | Set when the element is disabled | :host\n`focused` | Set when the element is focused | :host\n`focus-ring` | Set when the element is keyboard focused | :host\n`readonly` | Set when the element is readonly | :host\n`invalid` | Set when the element is invalid | :host\n`has-label` | Set when the element has a label | :host\n`has-value` | Set when the element has a value | :host\n`has-helper` | Set when the element has helper text | :host\n`has-error-message` | Set when the element has an error message | :host\n\n### Internal components\n\nThe following components are created by `<vaadin-date-time-picker>` and placed in light DOM:\n\n- [`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.5.2/#/elements/vaadin-date-picker).\n- [`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.5.2/#/elements/vaadin-time-picker).\n\nNote: the `theme` attribute value set on `<vaadin-date-time-picker>` is\npropagated to these components.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
20
20
  "extension": true,
21
21
  "attributes": [
22
22
  {
@@ -161,14 +161,14 @@
161
161
  },
162
162
  {
163
163
  "name": ".i18n",
164
- "description": "The object used to localize this component.\nTo change the default localization, replace the entire\n`i18n` object or just the properties you want to modify.\n\nThe object is a combination of the i18n properties supported by\n[`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.5.1/#/elements/vaadin-date-picker) and\n[`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.5.1/#/elements/vaadin-time-picker).",
164
+ "description": "The object used to localize this component.\nTo change the default localization, replace the entire\n`i18n` object or just the properties you want to modify.\n\nThe object is a combination of the i18n properties supported by\n[`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.5.2/#/elements/vaadin-date-picker) and\n[`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.5.2/#/elements/vaadin-time-picker).",
165
165
  "value": {
166
166
  "kind": "expression"
167
167
  }
168
168
  },
169
169
  {
170
170
  "name": ".overlayClass",
171
- "description": "A space-delimited list of CSS class names to set on the overlay elements\nof the internal components controlled by the `<vaadin-date-time-picker>`:\n\n- [`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.5.1/#/elements/vaadin-date-picker#property-overlayClass)\n- [`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.5.1/#/elements/vaadin-time-picker#property-overlayClass)",
171
+ "description": "A space-delimited list of CSS class names to set on the overlay elements\nof the internal components controlled by the `<vaadin-date-time-picker>`:\n\n- [`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.5.2/#/elements/vaadin-date-picker#property-overlayClass)\n- [`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/24.5.2/#/elements/vaadin-time-picker#property-overlayClass)",
172
172
  "value": {
173
173
  "kind": "expression"
174
174
  }