diff --git a/src/components/datetime/DateTime.js b/src/components/datetime/DateTime.js index da80202304..573c1356db 100644 --- a/src/components/datetime/DateTime.js +++ b/src/components/datetime/DateTime.js @@ -204,10 +204,14 @@ export default class DateTimeComponent extends Input { const timezone = this.timezone; if (value && !this.attached && timezone) { if (Array.isArray(value) && this.component.multiple) { - return value.map((item) => _.trim(FormioUtils.momentDate(item, format, timezone).format(format))).join(', '); + return value.map(item => _.trim(FormioUtils.momentDate(item, format, timezone).format(format))).join(', '); } return _.trim(FormioUtils.momentDate(value, format, timezone).format(format)); } + + if (Array.isArray(value) && this.component.multiple) { + return value.map(item => _.trim(moment(item).format(format))).join(', '); + } return (value ? _.trim(moment(value).format(format)) : value) || ''; } } diff --git a/src/components/time/Time.js b/src/components/time/Time.js index e4bd5a24c0..2ea0b44c34 100644 --- a/src/components/time/Time.js +++ b/src/components/time/Time.js @@ -157,7 +157,7 @@ export default class TimeComponent extends TextFieldComponent { getValueAsString(value) { if (Array.isArray(value) && this.component.multiple) { - return value.map((item) => moment(item, this.component.dataFormat).format(this.component.format)).join(', '); + return value.map(item => moment(item, this.component.dataFormat).format(this.component.format)).join(', '); } return (value ? moment(value, this.component.dataFormat).format(this.component.format) : value) || ''; }