diff --git a/src/components/date-picker/base/time-spinner.vue b/src/components/date-picker/base/time-spinner.vue
index c886d8b5..c8431ee9 100644
--- a/src/components/date-picker/base/time-spinner.vue
+++ b/src/components/date-picker/base/time-spinner.vue
@@ -2,17 +2,17 @@
- - {{ item.text < 10 ? '0' + item.text : item.text }}
+ - {{ formatTime(item.text) }}
- - {{ item.text < 10 ? '0' + item.text : item.text }}
+ - {{ formatTime(item.text) }}
- - {{ item.text < 10 ? '0' + item.text : item.text }}
+ - {{ formatTime(item.text) }}
@@ -185,6 +185,9 @@
});
this.$nextTick(() => times.forEach(type => this.$els[type].style.overflow = 'auto'));
});
+ },
+ formatTime (text) {
+ return text < 10 ? '0' + text : text;
}
},
watch: {