@atlaskit/datetime-picker 19.4.1 → 19.4.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/CHANGELOG.md +6 -0
- package/dist/cjs/components/date-picker.js +1 -1
- package/dist/cjs/components/date-time-picker.js +16 -4
- package/dist/cjs/components/time-picker.js +1 -1
- package/dist/es2019/components/date-picker.js +1 -1
- package/dist/es2019/components/date-time-picker.js +14 -4
- package/dist/es2019/components/time-picker.js +1 -1
- package/dist/esm/components/date-picker.js +1 -1
- package/dist/esm/components/date-time-picker.js +16 -4
- package/dist/esm/components/time-picker.js +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -47,7 +47,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
47
47
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
48
48
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
49
49
|
var packageName = "@atlaskit/datetime-picker";
|
|
50
|
-
var packageVersion = "19.4.
|
|
50
|
+
var packageVersion = "19.4.1";
|
|
51
51
|
var styles = {
|
|
52
52
|
pickerContainerStyle: "_kqswh2mm",
|
|
53
53
|
dropdownIndicatorStyles: "_1ul91k8s _1tke1k8s _1e0c1txw _4cvr1h6o _1bah1h6o",
|
|
@@ -35,7 +35,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
35
35
|
// for typing `process`
|
|
36
36
|
// oxlint-disable-next-line @atlassian/no-restricted-imports
|
|
37
37
|
var packageName = "@atlaskit/datetime-picker";
|
|
38
|
-
var packageVersion = "19.4.
|
|
38
|
+
var packageVersion = "19.4.1";
|
|
39
39
|
var analyticsAttributes = {
|
|
40
40
|
componentName: 'dateTimePicker',
|
|
41
41
|
packageName: packageName,
|
|
@@ -83,6 +83,9 @@ var getStyles = function getStyles(isInputMotionEnabled, roundedCorners) {
|
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
85
|
};
|
|
86
|
+
var hasExplicitZone = function hasExplicitZone(value) {
|
|
87
|
+
return value.endsWith('Z') || Math.max(value.lastIndexOf('+'), value.lastIndexOf('-')) > 15;
|
|
88
|
+
};
|
|
86
89
|
var parseDateTimeValueWithOffset = function parseDateTimeValueWithOffset(value) {
|
|
87
90
|
var parsed = (0, _dateFns.parseISO)(value);
|
|
88
91
|
var zoneStart = value.endsWith('Z') ? value.length - 1 : Math.max(value.lastIndexOf('+'), value.lastIndexOf('-'));
|
|
@@ -101,8 +104,7 @@ var parseDateTimeValueWithOffset = function parseDateTimeValueWithOffset(value)
|
|
|
101
104
|
};
|
|
102
105
|
var parseDateTimeValue = function parseDateTimeValue(value) {
|
|
103
106
|
if ((0, _fg.fg)('platform-dst-dtp-preserve-offset')) {
|
|
104
|
-
|
|
105
|
-
if (hasExplicitZone) {
|
|
107
|
+
if (hasExplicitZone(value)) {
|
|
106
108
|
return parseDateTimeValueWithOffset(value);
|
|
107
109
|
}
|
|
108
110
|
}
|
|
@@ -182,6 +184,7 @@ var DateTimePicker = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
|
182
184
|
isFocused = _useState2[0],
|
|
183
185
|
setIsFocused = _useState2[1];
|
|
184
186
|
var isInputMotionEnabled = (0, _fg.fg)('platform-dst-motion-uplift-input');
|
|
187
|
+
var isZoneExplicitRef = (0, _react.useRef)(false);
|
|
185
188
|
|
|
186
189
|
/**
|
|
187
190
|
* Defined inside the component so the reducer closes over `providedParseValue`
|
|
@@ -234,6 +237,7 @@ var DateTimePicker = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
|
234
237
|
var _useReducer = (0, _react.useReducer)(reducer, null, function () {
|
|
235
238
|
var _ref3;
|
|
236
239
|
var initialValue = (_ref3 = providedValue !== null && providedValue !== void 0 ? providedValue : defaultValue) !== null && _ref3 !== void 0 ? _ref3 : '';
|
|
240
|
+
isZoneExplicitRef.current = hasExplicitZone(initialValue);
|
|
237
241
|
var initialDate = (datePickerPropsWithSelectProps === null || datePickerPropsWithSelectProps === void 0 ? void 0 : datePickerPropsWithSelectProps.defaultValue) || '';
|
|
238
242
|
var initialTime = (timePickerPropsWithSelectProps === null || timePickerPropsWithSelectProps === void 0 ? void 0 : timePickerPropsWithSelectProps.defaultValue) || '';
|
|
239
243
|
if (!initialValue) {
|
|
@@ -275,6 +279,7 @@ var DateTimePicker = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
|
275
279
|
// `undefined` to the `value` prop will not clear the hidden input and will
|
|
276
280
|
// cause unexpected issues.
|
|
277
281
|
var hasReceivedProvidedValue = (0, _react.useRef)(providedValue !== undefined);
|
|
282
|
+
var lastEmittedValueRef = (0, _react.useRef)();
|
|
278
283
|
// We don't want to set the state on the first render, as it would
|
|
279
284
|
// needlessly be a duplicate.
|
|
280
285
|
var isFirstRender = (0, _react.useRef)(true);
|
|
@@ -285,12 +290,17 @@ var DateTimePicker = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
|
285
290
|
}
|
|
286
291
|
if (providedValue !== undefined) {
|
|
287
292
|
hasReceivedProvidedValue.current = true;
|
|
293
|
+
if (providedValue !== lastEmittedValueRef.current) {
|
|
294
|
+
isZoneExplicitRef.current = hasExplicitZone(providedValue);
|
|
295
|
+
}
|
|
288
296
|
dispatch({
|
|
289
297
|
type: 'SET_VALUE',
|
|
290
298
|
payload: providedValue
|
|
291
299
|
});
|
|
292
300
|
} else if (hasReceivedProvidedValue.current) {
|
|
293
301
|
hasReceivedProvidedValue.current = false;
|
|
302
|
+
isZoneExplicitRef.current = false;
|
|
303
|
+
lastEmittedValueRef.current = undefined;
|
|
294
304
|
dispatch({
|
|
295
305
|
type: 'SET_VALUE',
|
|
296
306
|
payload: ''
|
|
@@ -394,7 +404,8 @@ var DateTimePicker = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
|
394
404
|
providedZoneValue = _ref4.providedZoneValue;
|
|
395
405
|
if (providedDateValue && providedTimeValue) {
|
|
396
406
|
var isoValue = (0, _formatDateTimeZoneIntoIso.formatDateTimeZoneIntoIso)(providedDateValue, providedTimeValue, providedZoneValue);
|
|
397
|
-
var
|
|
407
|
+
var valueToParse = (0, _fg.fg)('platform-dst-dtp-preserve-offset') && !providedParseValue && !isZoneExplicitRef.current ? (0, _formatDateTimeZoneIntoIso.formatDateTimeZoneIntoIso)(providedDateValue, providedTimeValue, '') : isoValue;
|
|
408
|
+
var _parseValue = parseValue(valueToParse, providedDateValue, providedTimeValue, providedZoneValue),
|
|
398
409
|
parsedZone = _parseValue.zoneValue;
|
|
399
410
|
var valueWithValidZone = (0, _formatDateTimeZoneIntoIso.formatDateTimeZoneIntoIso)(providedDateValue, providedTimeValue, parsedZone);
|
|
400
411
|
dispatch({
|
|
@@ -406,6 +417,7 @@ var DateTimePicker = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
|
406
417
|
zoneValue: parsedZone
|
|
407
418
|
}
|
|
408
419
|
});
|
|
420
|
+
lastEmittedValueRef.current = valueWithValidZone;
|
|
409
421
|
onChangePropWithAnalytics(valueWithValidZone);
|
|
410
422
|
// If the date or time value was cleared when there is an existing datetime value, then clear the value.
|
|
411
423
|
} else if (dtState.value) {
|
|
@@ -38,7 +38,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
38
38
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
39
39
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } // oxlint-disable-next-line @atlassian/no-restricted-imports
|
|
40
40
|
var packageName = "@atlaskit/datetime-picker";
|
|
41
|
-
var packageVersion = "19.4.
|
|
41
|
+
var packageVersion = "19.4.1";
|
|
42
42
|
var defaultTimeFormat = 'h:mma';
|
|
43
43
|
var menuStyles = {
|
|
44
44
|
/* Need to remove default absolute positioning as that causes issues with position fixed */
|
|
@@ -32,7 +32,7 @@ import { parseDate } from '../internal/parse-date';
|
|
|
32
32
|
import { PickerButtonContainer } from '../internal/picker-button-container';
|
|
33
33
|
import { makeSingleValue } from '../internal/single-value';
|
|
34
34
|
const packageName = "@atlaskit/datetime-picker";
|
|
35
|
-
const packageVersion = "19.4.
|
|
35
|
+
const packageVersion = "19.4.1";
|
|
36
36
|
const styles = {
|
|
37
37
|
pickerContainerStyle: "_kqswh2mm",
|
|
38
38
|
dropdownIndicatorStyles: "_1ul91k8s _1tke1k8s _1e0c1txw _4cvr1h6o _1bah1h6o",
|
|
@@ -22,7 +22,7 @@ import { convertTokens } from '../internal/parse-tokens';
|
|
|
22
22
|
import DatePicker from './date-picker';
|
|
23
23
|
import TimePicker from './time-picker';
|
|
24
24
|
const packageName = "@atlaskit/datetime-picker";
|
|
25
|
-
const packageVersion = "19.4.
|
|
25
|
+
const packageVersion = "19.4.1";
|
|
26
26
|
const analyticsAttributes = {
|
|
27
27
|
componentName: 'dateTimePicker',
|
|
28
28
|
packageName,
|
|
@@ -70,6 +70,7 @@ const getStyles = (isInputMotionEnabled, roundedCorners) => ({
|
|
|
70
70
|
}
|
|
71
71
|
})
|
|
72
72
|
});
|
|
73
|
+
const hasExplicitZone = value => value.endsWith('Z') || Math.max(value.lastIndexOf('+'), value.lastIndexOf('-')) > 15;
|
|
73
74
|
const parseDateTimeValueWithOffset = value => {
|
|
74
75
|
const parsed = parseISO(value);
|
|
75
76
|
const zoneStart = value.endsWith('Z') ? value.length - 1 : Math.max(value.lastIndexOf('+'), value.lastIndexOf('-'));
|
|
@@ -88,8 +89,7 @@ const parseDateTimeValueWithOffset = value => {
|
|
|
88
89
|
};
|
|
89
90
|
const parseDateTimeValue = value => {
|
|
90
91
|
if (fg('platform-dst-dtp-preserve-offset')) {
|
|
91
|
-
|
|
92
|
-
if (hasExplicitZone) {
|
|
92
|
+
if (hasExplicitZone(value)) {
|
|
93
93
|
return parseDateTimeValueWithOffset(value);
|
|
94
94
|
}
|
|
95
95
|
}
|
|
@@ -154,6 +154,7 @@ const DateTimePicker = /*#__PURE__*/forwardRef(({
|
|
|
154
154
|
}, ref) => {
|
|
155
155
|
const [isFocused, setIsFocused] = useState(false);
|
|
156
156
|
const isInputMotionEnabled = fg('platform-dst-motion-uplift-input');
|
|
157
|
+
const isZoneExplicitRef = useRef(false);
|
|
157
158
|
|
|
158
159
|
/**
|
|
159
160
|
* Defined inside the component so the reducer closes over `providedParseValue`
|
|
@@ -208,6 +209,7 @@ const DateTimePicker = /*#__PURE__*/forwardRef(({
|
|
|
208
209
|
const [dtState, dispatch] = useReducer(reducer, null, () => {
|
|
209
210
|
var _ref;
|
|
210
211
|
const initialValue = (_ref = providedValue !== null && providedValue !== void 0 ? providedValue : defaultValue) !== null && _ref !== void 0 ? _ref : '';
|
|
212
|
+
isZoneExplicitRef.current = hasExplicitZone(initialValue);
|
|
211
213
|
const initialDate = (datePickerPropsWithSelectProps === null || datePickerPropsWithSelectProps === void 0 ? void 0 : datePickerPropsWithSelectProps.defaultValue) || '';
|
|
212
214
|
const initialTime = (timePickerPropsWithSelectProps === null || timePickerPropsWithSelectProps === void 0 ? void 0 : timePickerPropsWithSelectProps.defaultValue) || '';
|
|
213
215
|
if (!initialValue) {
|
|
@@ -248,6 +250,7 @@ const DateTimePicker = /*#__PURE__*/forwardRef(({
|
|
|
248
250
|
// `undefined` to the `value` prop will not clear the hidden input and will
|
|
249
251
|
// cause unexpected issues.
|
|
250
252
|
const hasReceivedProvidedValue = useRef(providedValue !== undefined);
|
|
253
|
+
const lastEmittedValueRef = useRef();
|
|
251
254
|
// We don't want to set the state on the first render, as it would
|
|
252
255
|
// needlessly be a duplicate.
|
|
253
256
|
const isFirstRender = useRef(true);
|
|
@@ -258,12 +261,17 @@ const DateTimePicker = /*#__PURE__*/forwardRef(({
|
|
|
258
261
|
}
|
|
259
262
|
if (providedValue !== undefined) {
|
|
260
263
|
hasReceivedProvidedValue.current = true;
|
|
264
|
+
if (providedValue !== lastEmittedValueRef.current) {
|
|
265
|
+
isZoneExplicitRef.current = hasExplicitZone(providedValue);
|
|
266
|
+
}
|
|
261
267
|
dispatch({
|
|
262
268
|
type: 'SET_VALUE',
|
|
263
269
|
payload: providedValue
|
|
264
270
|
});
|
|
265
271
|
} else if (hasReceivedProvidedValue.current) {
|
|
266
272
|
hasReceivedProvidedValue.current = false;
|
|
273
|
+
isZoneExplicitRef.current = false;
|
|
274
|
+
lastEmittedValueRef.current = undefined;
|
|
267
275
|
dispatch({
|
|
268
276
|
type: 'SET_VALUE',
|
|
269
277
|
payload: ''
|
|
@@ -369,9 +377,10 @@ const DateTimePicker = /*#__PURE__*/forwardRef(({
|
|
|
369
377
|
}) => {
|
|
370
378
|
if (providedDateValue && providedTimeValue) {
|
|
371
379
|
const isoValue = formatDateTimeZoneIntoIso(providedDateValue, providedTimeValue, providedZoneValue);
|
|
380
|
+
const valueToParse = fg('platform-dst-dtp-preserve-offset') && !providedParseValue && !isZoneExplicitRef.current ? formatDateTimeZoneIntoIso(providedDateValue, providedTimeValue, '') : isoValue;
|
|
372
381
|
const {
|
|
373
382
|
zoneValue: parsedZone
|
|
374
|
-
} = parseValue(
|
|
383
|
+
} = parseValue(valueToParse, providedDateValue, providedTimeValue, providedZoneValue);
|
|
375
384
|
const valueWithValidZone = formatDateTimeZoneIntoIso(providedDateValue, providedTimeValue, parsedZone);
|
|
376
385
|
dispatch({
|
|
377
386
|
type: 'APPLY',
|
|
@@ -382,6 +391,7 @@ const DateTimePicker = /*#__PURE__*/forwardRef(({
|
|
|
382
391
|
zoneValue: parsedZone
|
|
383
392
|
}
|
|
384
393
|
});
|
|
394
|
+
lastEmittedValueRef.current = valueWithValidZone;
|
|
385
395
|
onChangePropWithAnalytics(valueWithValidZone);
|
|
386
396
|
// If the date or time value was cleared when there is an existing datetime value, then clear the value.
|
|
387
397
|
} else if (dtState.value) {
|
|
@@ -25,7 +25,7 @@ import { PickerButtonContainer } from '../internal/picker-button-container';
|
|
|
25
25
|
import { placeholderDatetime } from '../internal/placeholder-date-time';
|
|
26
26
|
import { makeSingleValue } from '../internal/single-value';
|
|
27
27
|
const packageName = "@atlaskit/datetime-picker";
|
|
28
|
-
const packageVersion = "19.4.
|
|
28
|
+
const packageVersion = "19.4.1";
|
|
29
29
|
const defaultTimeFormat = 'h:mma';
|
|
30
30
|
const menuStyles = {
|
|
31
31
|
/* Need to remove default absolute positioning as that causes issues with position fixed */
|
|
@@ -40,7 +40,7 @@ import { parseDate } from '../internal/parse-date';
|
|
|
40
40
|
import { PickerButtonContainer } from '../internal/picker-button-container';
|
|
41
41
|
import { makeSingleValue } from '../internal/single-value';
|
|
42
42
|
var packageName = "@atlaskit/datetime-picker";
|
|
43
|
-
var packageVersion = "19.4.
|
|
43
|
+
var packageVersion = "19.4.1";
|
|
44
44
|
var styles = {
|
|
45
45
|
pickerContainerStyle: "_kqswh2mm",
|
|
46
46
|
dropdownIndicatorStyles: "_1ul91k8s _1tke1k8s _1e0c1txw _4cvr1h6o _1bah1h6o",
|
|
@@ -29,7 +29,7 @@ import { convertTokens } from '../internal/parse-tokens';
|
|
|
29
29
|
import DatePicker from './date-picker';
|
|
30
30
|
import TimePicker from './time-picker';
|
|
31
31
|
var packageName = "@atlaskit/datetime-picker";
|
|
32
|
-
var packageVersion = "19.4.
|
|
32
|
+
var packageVersion = "19.4.1";
|
|
33
33
|
var analyticsAttributes = {
|
|
34
34
|
componentName: 'dateTimePicker',
|
|
35
35
|
packageName: packageName,
|
|
@@ -77,6 +77,9 @@ var getStyles = function getStyles(isInputMotionEnabled, roundedCorners) {
|
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
79
|
};
|
|
80
|
+
var hasExplicitZone = function hasExplicitZone(value) {
|
|
81
|
+
return value.endsWith('Z') || Math.max(value.lastIndexOf('+'), value.lastIndexOf('-')) > 15;
|
|
82
|
+
};
|
|
80
83
|
var parseDateTimeValueWithOffset = function parseDateTimeValueWithOffset(value) {
|
|
81
84
|
var parsed = parseISO(value);
|
|
82
85
|
var zoneStart = value.endsWith('Z') ? value.length - 1 : Math.max(value.lastIndexOf('+'), value.lastIndexOf('-'));
|
|
@@ -95,8 +98,7 @@ var parseDateTimeValueWithOffset = function parseDateTimeValueWithOffset(value)
|
|
|
95
98
|
};
|
|
96
99
|
var parseDateTimeValue = function parseDateTimeValue(value) {
|
|
97
100
|
if (fg('platform-dst-dtp-preserve-offset')) {
|
|
98
|
-
|
|
99
|
-
if (hasExplicitZone) {
|
|
101
|
+
if (hasExplicitZone(value)) {
|
|
100
102
|
return parseDateTimeValueWithOffset(value);
|
|
101
103
|
}
|
|
102
104
|
}
|
|
@@ -176,6 +178,7 @@ var DateTimePicker = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
176
178
|
isFocused = _useState2[0],
|
|
177
179
|
setIsFocused = _useState2[1];
|
|
178
180
|
var isInputMotionEnabled = fg('platform-dst-motion-uplift-input');
|
|
181
|
+
var isZoneExplicitRef = useRef(false);
|
|
179
182
|
|
|
180
183
|
/**
|
|
181
184
|
* Defined inside the component so the reducer closes over `providedParseValue`
|
|
@@ -228,6 +231,7 @@ var DateTimePicker = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
228
231
|
var _useReducer = useReducer(reducer, null, function () {
|
|
229
232
|
var _ref3;
|
|
230
233
|
var initialValue = (_ref3 = providedValue !== null && providedValue !== void 0 ? providedValue : defaultValue) !== null && _ref3 !== void 0 ? _ref3 : '';
|
|
234
|
+
isZoneExplicitRef.current = hasExplicitZone(initialValue);
|
|
231
235
|
var initialDate = (datePickerPropsWithSelectProps === null || datePickerPropsWithSelectProps === void 0 ? void 0 : datePickerPropsWithSelectProps.defaultValue) || '';
|
|
232
236
|
var initialTime = (timePickerPropsWithSelectProps === null || timePickerPropsWithSelectProps === void 0 ? void 0 : timePickerPropsWithSelectProps.defaultValue) || '';
|
|
233
237
|
if (!initialValue) {
|
|
@@ -269,6 +273,7 @@ var DateTimePicker = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
269
273
|
// `undefined` to the `value` prop will not clear the hidden input and will
|
|
270
274
|
// cause unexpected issues.
|
|
271
275
|
var hasReceivedProvidedValue = useRef(providedValue !== undefined);
|
|
276
|
+
var lastEmittedValueRef = useRef();
|
|
272
277
|
// We don't want to set the state on the first render, as it would
|
|
273
278
|
// needlessly be a duplicate.
|
|
274
279
|
var isFirstRender = useRef(true);
|
|
@@ -279,12 +284,17 @@ var DateTimePicker = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
279
284
|
}
|
|
280
285
|
if (providedValue !== undefined) {
|
|
281
286
|
hasReceivedProvidedValue.current = true;
|
|
287
|
+
if (providedValue !== lastEmittedValueRef.current) {
|
|
288
|
+
isZoneExplicitRef.current = hasExplicitZone(providedValue);
|
|
289
|
+
}
|
|
282
290
|
dispatch({
|
|
283
291
|
type: 'SET_VALUE',
|
|
284
292
|
payload: providedValue
|
|
285
293
|
});
|
|
286
294
|
} else if (hasReceivedProvidedValue.current) {
|
|
287
295
|
hasReceivedProvidedValue.current = false;
|
|
296
|
+
isZoneExplicitRef.current = false;
|
|
297
|
+
lastEmittedValueRef.current = undefined;
|
|
288
298
|
dispatch({
|
|
289
299
|
type: 'SET_VALUE',
|
|
290
300
|
payload: ''
|
|
@@ -388,7 +398,8 @@ var DateTimePicker = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
388
398
|
providedZoneValue = _ref4.providedZoneValue;
|
|
389
399
|
if (providedDateValue && providedTimeValue) {
|
|
390
400
|
var isoValue = formatDateTimeZoneIntoIso(providedDateValue, providedTimeValue, providedZoneValue);
|
|
391
|
-
var
|
|
401
|
+
var valueToParse = fg('platform-dst-dtp-preserve-offset') && !providedParseValue && !isZoneExplicitRef.current ? formatDateTimeZoneIntoIso(providedDateValue, providedTimeValue, '') : isoValue;
|
|
402
|
+
var _parseValue = parseValue(valueToParse, providedDateValue, providedTimeValue, providedZoneValue),
|
|
392
403
|
parsedZone = _parseValue.zoneValue;
|
|
393
404
|
var valueWithValidZone = formatDateTimeZoneIntoIso(providedDateValue, providedTimeValue, parsedZone);
|
|
394
405
|
dispatch({
|
|
@@ -400,6 +411,7 @@ var DateTimePicker = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
400
411
|
zoneValue: parsedZone
|
|
401
412
|
}
|
|
402
413
|
});
|
|
414
|
+
lastEmittedValueRef.current = valueWithValidZone;
|
|
403
415
|
onChangePropWithAnalytics(valueWithValidZone);
|
|
404
416
|
// If the date or time value was cleared when there is an existing datetime value, then clear the value.
|
|
405
417
|
} else if (dtState.value) {
|
|
@@ -31,7 +31,7 @@ import { PickerButtonContainer } from '../internal/picker-button-container';
|
|
|
31
31
|
import { placeholderDatetime } from '../internal/placeholder-date-time';
|
|
32
32
|
import { makeSingleValue } from '../internal/single-value';
|
|
33
33
|
var packageName = "@atlaskit/datetime-picker";
|
|
34
|
-
var packageVersion = "19.4.
|
|
34
|
+
var packageVersion = "19.4.1";
|
|
35
35
|
var defaultTimeFormat = 'h:mma';
|
|
36
36
|
var menuStyles = {
|
|
37
37
|
/* Need to remove default absolute positioning as that causes issues with position fixed */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/datetime-picker",
|
|
3
|
-
"version": "19.4.
|
|
3
|
+
"version": "19.4.2",
|
|
4
4
|
"description": "A date time picker allows the user to select an associated date and time.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
49
49
|
"@atlaskit/react-select": "^4.12.0",
|
|
50
50
|
"@atlaskit/select": "^23.1.0",
|
|
51
|
-
"@atlaskit/tokens": "^20.
|
|
52
|
-
"@atlaskit/top-layer": "^
|
|
51
|
+
"@atlaskit/tokens": "^20.8.0",
|
|
52
|
+
"@atlaskit/top-layer": "^7.0.0",
|
|
53
53
|
"@babel/runtime": "^7.0.0",
|
|
54
54
|
"@compiled/react": "^1.0.2",
|
|
55
55
|
"date-fns": "^2.17.0"
|
|
@@ -64,15 +64,15 @@
|
|
|
64
64
|
"@atlaskit/code": "^20.0.0",
|
|
65
65
|
"@atlaskit/codemod-utils": "^5.1.0",
|
|
66
66
|
"@atlaskit/docs": "^12.3.0",
|
|
67
|
-
"@atlaskit/form": "^18.
|
|
67
|
+
"@atlaskit/form": "^18.3.0",
|
|
68
68
|
"@atlaskit/heading": "^8.0.0",
|
|
69
69
|
"@atlaskit/link": "^5.1.0",
|
|
70
70
|
"@atlaskit/menu": "^11.0.0",
|
|
71
71
|
"@atlaskit/modal-dialog": "^17.1.0",
|
|
72
|
-
"@atlaskit/popup": "^10.
|
|
72
|
+
"@atlaskit/popup": "^10.1.0",
|
|
73
73
|
"@atlaskit/range": "^12.2.0",
|
|
74
74
|
"@atlaskit/section-message": "^10.2.0",
|
|
75
|
-
"@atlaskit/textfield": "^10.
|
|
75
|
+
"@atlaskit/textfield": "^10.3.0",
|
|
76
76
|
"@atlaskit/toggle": "^17.3.0",
|
|
77
77
|
"@atlassian/feature-flags-test-utils": "^1.3.0",
|
|
78
78
|
"@atlassian/ssr-tests": "workspace:^",
|