diff --git a/src/components/datetime/DateTime.js b/src/components/datetime/DateTime.js index e07a334c0f..da80202304 100644 --- a/src/components/datetime/DateTime.js +++ b/src/components/datetime/DateTime.js @@ -203,6 +203,9 @@ export default class DateTimeComponent extends Input { format += format.match(/z$/) ? '' : ' z'; 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 _.trim(FormioUtils.momentDate(value, format, timezone).format(format)); } return (value ? _.trim(moment(value).format(format)) : value) || ''; diff --git a/src/components/time/Time.js b/src/components/time/Time.js index ac8f4e8585..e4bd5a24c0 100644 --- a/src/components/time/Time.js +++ b/src/components/time/Time.js @@ -156,6 +156,9 @@ 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 ? moment(value, this.component.dataFormat).format(this.component.format) : value) || ''; }