|
@@ -10,9 +10,9 @@ export const cron = {
|
|
|
let h = "";
|
|
|
let date = new Date();
|
|
|
if (date) {
|
|
|
- h = date.getHours();
|
|
|
- m = date.getMinutes();
|
|
|
- s = date.getSeconds();
|
|
|
+ h = date.getHours()< 10 ? ("0" + date.getHours()) : date.getHours();
|
|
|
+ m = date.getMinutes()< 10 ? ("0" + date.getMinutes()) : date.getMinutes();
|
|
|
+ s = date.getSeconds()< 10 ? ("0" + date.getSeconds()) : date.getSeconds();
|
|
|
}
|
|
|
this.$set(this,'value',h+':'+m+':'+s)
|
|
|
cron = s + " " + m + " " + h + " * * ? *";
|
|
@@ -58,9 +58,9 @@ export const cron = {
|
|
|
this.$set(this,'day',en2cnMap[value1])
|
|
|
let date = new Date();
|
|
|
if (date) {
|
|
|
- h = date.getHours();
|
|
|
- m = date.getMinutes();
|
|
|
- s = date.getSeconds();
|
|
|
+ h = date.getHours()< 10 ? ("0" + date.getHours()) : date.getHours();
|
|
|
+ m = date.getMinutes()< 10 ? ("0" + date.getMinutes()) : date.getMinutes();
|
|
|
+ s = date.getSeconds()< 10 ? ("0" + date.getSeconds()) : date.getSeconds();
|
|
|
}
|
|
|
this.$set(this, 'time', (h < 10 ? ("0" + h) : h )+ ':' + (m < 10 ? ("0" + m) : m) + ':' + (s < 10 ? ("0" + s) : s))
|
|
|
this.$set(this, 'value', this.day + " " + this.time)
|
|
@@ -74,9 +74,9 @@ export const cron = {
|
|
|
var date = new Date();
|
|
|
if (date) {
|
|
|
mo = date.getDate()
|
|
|
- h = date.getHours();
|
|
|
- m = date.getMinutes();
|
|
|
- s = date.getSeconds();
|
|
|
+ h = date.getHours()< 10 ? ("0" + date.getHours()) : date.getHours();
|
|
|
+ m = date.getMinutes()< 10 ? ("0" + date.getMinutes()) : date.getMinutes();
|
|
|
+ s = date.getSeconds()< 10 ? ("0" + date.getSeconds()) : date.getSeconds();
|
|
|
}
|
|
|
this.$set(this,'day',mo+'日')
|
|
|
this.$set(this, 'time', (h < 10 ? ("0" + h) : h )+ ':' + (m < 10 ? ("0" + m) : m) + ':' + (s < 10 ? ("0" + s) : s))
|
|
@@ -93,12 +93,12 @@ export const cron = {
|
|
|
|
|
|
var date = new Date();
|
|
|
if (date) {
|
|
|
- h = date.getHours();
|
|
|
- m = date.getMinutes();
|
|
|
- s = date.getSeconds();
|
|
|
+ h = date.getHours()< 10 ? ("0" + date.getHours()) : date.getHours();
|
|
|
+ m = date.getMinutes()< 10 ? ("0" + date.getMinutes()) : date.getMinutes();
|
|
|
+ s = date.getSeconds()< 10 ? ("0" + date.getSeconds()) : date.getSeconds();
|
|
|
year = date.getFullYear();
|
|
|
- month =date.getMonth() + 1
|
|
|
- day = date.getDate()
|
|
|
+ month = (date.getMonth() + 1 )< 10 ? ("0" + (date.getMonth() + 1 )) : (date.getMonth() + 1 )
|
|
|
+ day = date.getDate() < 10 ? ("0" + date.getDate()) : date.getDate()
|
|
|
}
|
|
|
this.$set(this,'value',date)
|
|
|
cron =
|
|
@@ -193,12 +193,12 @@ export const cron = {
|
|
|
var date = this.value;
|
|
|
date = new Date(date);
|
|
|
if (date) {
|
|
|
- h = date.getHours();
|
|
|
- m = date.getMinutes();
|
|
|
- s = date.getSeconds();
|
|
|
+ h = date.getHours()< 10 ? ("0" + date.getHours()) : date.getHours();
|
|
|
+ m = date.getMinutes()< 10 ? ("0" + date.getMinutes()) : date.getMinutes();
|
|
|
+ s = date.getSeconds()< 10 ? ("0" + date.getSeconds()) : date.getSeconds();
|
|
|
year = date.getFullYear();
|
|
|
- month = date.getMonth() + 1
|
|
|
- day = date.getDate()
|
|
|
+ month = (date.getMonth() + 1 )< 10 ? ("0" + (date.getMonth() + 1 )) : (date.getMonth() + 1 )
|
|
|
+ day = date.getDate() < 10 ? ("0" + date.getDate()) : date.getDate()
|
|
|
}
|
|
|
cron =
|
|
|
s +
|