diff --git a/src/components/datetime/DateTime.js b/src/components/datetime/DateTime.js index e07a334c0f..573c1356db 100644 --- a/src/components/datetime/DateTime.js +++ b/src/components/datetime/DateTime.js @@ -203,8 +203,15 @@ 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)); } + + 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 ac8f4e8585..2ea0b44c34 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) || ''; }