@formio/js 5.1.0-dev.6080.9f2079e → 5.1.0-dev.6082.51d4e33
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/dist/formio.form.js +6 -6
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +6 -6
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.utils.js +1 -1
- package/dist/formio.utils.min.js +1 -1
- package/lib/cjs/components/_classes/component/Component.d.ts +27 -2
- package/lib/cjs/components/_classes/component/Component.js +62 -32
- package/lib/cjs/components/form/Form.d.ts +0 -1
- package/lib/cjs/components/form/Form.js +12 -20
- package/lib/cjs/components/textfield/TextField.js +2 -2
- package/lib/cjs/providers/storage/uploadAdapter.js +5 -3
- package/lib/cjs/utils/utils.d.ts +9 -0
- package/lib/cjs/utils/utils.js +16 -1
- package/lib/cjs/widgets/CalendarWidget.js +6 -1
- package/lib/mjs/components/_classes/component/Component.d.ts +27 -2
- package/lib/mjs/components/_classes/component/Component.js +62 -32
- package/lib/mjs/components/form/Form.d.ts +0 -1
- package/lib/mjs/components/form/Form.js +12 -20
- package/lib/mjs/components/textfield/TextField.js +2 -2
- package/lib/mjs/providers/storage/uploadAdapter.js +5 -3
- package/lib/mjs/utils/utils.d.ts +9 -0
- package/lib/mjs/utils/utils.js +14 -0
- package/lib/mjs/widgets/CalendarWidget.js +7 -2
- package/package.json +1 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
import { Formio } from '../Formio';
|
2
2
|
import InputWidget from './InputWidget';
|
3
|
-
import { convertFormatToFlatpickr, convertFormatToMask, convertFormatToMoment, formatDate, formatOffset, getBrowserInfo, getDateSetting, getLocaleDateFormatInfo, momentDate, zonesLoaded, shouldLoadZones, loadZones, } from '../utils/utils';
|
3
|
+
import { convertFormatToFlatpickr, convertFormatToMask, convertFormatToMoment, formatDate, formatOffset, getBrowserInfo, getDateSetting, getLocaleDateFormatInfo, momentDate, zonesLoaded, shouldLoadZones, loadZones, hasEncodedTimezone, } from '../utils/utils';
|
4
4
|
import moment from 'moment';
|
5
5
|
import _ from 'lodash';
|
6
6
|
const DEFAULT_FORMAT = 'yyyy-MM-dd hh:mm a';
|
@@ -278,6 +278,11 @@ export default class CalendarWidget extends InputWidget {
|
|
278
278
|
value = value ? formatDate(this.timezonesUrl, value, convertFormatToMoment(this.settings.format), this.timezone, convertFormatToMoment(this.valueMomentFormat)) : value;
|
279
279
|
return super.setValue(value);
|
280
280
|
}
|
281
|
+
// If the component is a textfield that does not have timezone information included in the string value then skip
|
282
|
+
// the timezone offset
|
283
|
+
if (this.component.type === 'textfield' && !hasEncodedTimezone(value)) {
|
284
|
+
this.settings.skipOffset = true;
|
285
|
+
}
|
281
286
|
const zonesLoading = this.loadZones();
|
282
287
|
if (value) {
|
283
288
|
if (!saveAsText && this.settings.readOnly && !zonesLoading) {
|
@@ -443,7 +448,7 @@ export default class CalendarWidget extends InputWidget {
|
|
443
448
|
return (date, format) => {
|
444
449
|
// Only format this if this is the altFormat and the form is readOnly.
|
445
450
|
if (this.settings.readOnly && (format === this.settings.altFormat)) {
|
446
|
-
if (!this.settings.enableTime || this.loadZones()) {
|
451
|
+
if (!this.settings.enableTime || this.loadZones() || this.settings.skipOffset) {
|
447
452
|
return Flatpickr.formatDate(date, format);
|
448
453
|
}
|
449
454
|
const currentValue = new Date(this.getValue());
|