diff --git a/frontend/src/components/canvas/components/Editor/DateFormat.vue b/frontend/src/components/canvas/components/Editor/DateFormat.vue
index 48b41e3307..97e0d45673 100644
--- a/frontend/src/components/canvas/components/Editor/DateFormat.vue
+++ b/frontend/src/components/canvas/components/Editor/DateFormat.vue
@@ -97,7 +97,8 @@ export default {
timeOptions: [
{ value: 'hh:mm:ss', label: 'hh:mm:ss' },
- { value: 'hh时mm分ss秒', label: 'hh时mm分ss秒' }
+ { value: 'hh时mm分ss秒', label: 'hh时mm分ss秒' },
+ { value: '', label: '无' }
],
dateOptions: [
{ value: 'yyyy-MM-dd', label: 'yyyy-MM-dd' },
diff --git a/frontend/src/components/widget/DeWidget/DeShowDate.vue b/frontend/src/components/widget/DeWidget/DeShowDate.vue
index 5b71e6a3d5..6b95c13419 100644
--- a/frontend/src/components/widget/DeWidget/DeShowDate.vue
+++ b/frontend/src/components/widget/DeWidget/DeShowDate.vue
@@ -1,12 +1,12 @@
-
+
-
+
-
+
-
+
diff --git a/frontend/src/components/widget/DeWidget/TimeDefault.vue b/frontend/src/components/widget/DeWidget/TimeDefault.vue
index c33066b290..5b59dcd0cc 100644
--- a/frontend/src/components/widget/DeWidget/TimeDefault.vue
+++ b/frontend/src/components/widget/DeWidget/TimeDefault.vue
@@ -44,7 +44,7 @@ export default {
},
formatDate() {
const weekArr = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
- let timeFormat = this.element.formatInfo.timeFormat || 'hh:mm:ss'
+ let timeFormat = this.element.formatInfo.timeFormat
const showWeek = this.element.formatInfo.showWeek
const showDate = this.element.formatInfo.showDate
const dateFormat = this.element.formatInfo.dateFormat || 'yyyy-MM-dd'
diff --git a/frontend/src/components/widget/DeWidget/TimeElec.vue b/frontend/src/components/widget/DeWidget/TimeElec.vue
index 0ad7958f40..0270662399 100644
--- a/frontend/src/components/widget/DeWidget/TimeElec.vue
+++ b/frontend/src/components/widget/DeWidget/TimeElec.vue
@@ -1,7 +1,7 @@
{{ date }}
-
{{ time }}
+
{{ time }}
@@ -66,7 +66,7 @@ export default {
},
updateTime() {
var cd = new Date()
- const timeFormat = this.element.formatInfo.timeFormat || 'hh:mm:ss'
+ const timeFormat = this.element.formatInfo.timeFormat
const showWeek = this.element.formatInfo.showWeek
const showDate = this.element.formatInfo.showDate
const dateFormat = this.element.formatInfo.dateFormat || 'yyyy-MM-dd'
@@ -75,8 +75,12 @@ export default {
nowDate = cd.format(dateFormat)
}
const nowWeek = this.week[cd.getDay()]
+ if (timeFormat) {
+ this.time = cd.format(timeFormat)
+ } else {
+ this.time = null
+ }
- this.time = cd.format(timeFormat)
this.date = showWeek ? (nowDate + ' ' + nowWeek) : nowDate
}
}
diff --git a/frontend/src/components/widget/DeWidget/TimeSimple.vue b/frontend/src/components/widget/DeWidget/TimeSimple.vue
index badb0ecd83..a33212b60e 100644
--- a/frontend/src/components/widget/DeWidget/TimeSimple.vue
+++ b/frontend/src/components/widget/DeWidget/TimeSimple.vue
@@ -65,7 +65,7 @@ export default {
this.timer = setInterval(this.canvass, 500)
},
canvass() {
- const timeFormat = this.element.formatInfo.timeFormat || 'hh:mm:ss'
+ const timeFormat = this.element.formatInfo.timeFormat
const dateFormat = this.element.formatInfo.dateFormat || 'yyyy-MM-dd'
const showWeek = this.element.formatInfo.showWeek
const showDate = this.element.formatInfo.showDate
@@ -110,8 +110,10 @@ export default {
} else {
englishWeek = 'Saturday'
}
-
- const simpleTime = time.format(timeFormat)
+ let simpleTime = ''
+ if (timeFormat) {
+ simpleTime = time.format(timeFormat)
+ }
let nowDate = ''
if (showDate && dateFormat) {
nowDate = time.format(dateFormat)