Skip to content

Commit bd84a5c

Browse files
committed
ui: fix date input issue
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent aaf75ed commit bd84a5c

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

ui/src/views/extension/RunCustomAction.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ export default {
130130
this.fetchCustomActions()
131131
},
132132
computed: {
133+
datePattern () {
134+
return 'YYYY-MM-DDTHH:mm:ssZ'
135+
},
133136
resourceType () {
134137
const metaResourceType = this.$route.meta.resourceType
135138
if (metaResourceType && !['UserVm', 'DomainRouter', 'SystemVm'].includes(metaResourceType)) {
@@ -244,12 +247,12 @@ export default {
244247
keys = keys.filter(k => k !== 'customactionid')
245248
for (const key of keys) {
246249
var value = values[key]
247-
const fieldDef = this.currentParameters.find(f => f.name === key)
248-
if (fieldDef?.type === 'DATE' && value instanceof Date) {
249-
value = value.toISOString()
250-
}
251250
if (value !== undefined && value != null &&
252251
(typeof value !== 'string' || (typeof value === 'string' && value.trim().length > 0))) {
252+
const fieldDef = this.currentParameters.find(f => f.name === key)
253+
if (fieldDef?.type === 'DATE') {
254+
value = value.format(this.datePattern)
255+
}
253256
params['parameters[0].' + key] = value
254257
}
255258
}

0 commit comments

Comments
 (0)