修复日期控件初始化格式可能错误的问题

This commit is contained in:
刘祥超
2021-09-15 19:40:42 +08:00
parent 0f28df51f1
commit a8b947f5ca
2 changed files with 136 additions and 135 deletions

View File

@@ -132,7 +132,7 @@ Vue.component("datetime-input", {
this.hasSecondError = false this.hasSecondError = false
date.setSeconds(second) date.setSeconds(second)
this.timestamp = parseInt(date.getTime() / 1000) this.timestamp = Math.ceil(date.getTime() / 1000)
}, },
leadingZero: function (s, l) { leadingZero: function (s, l) {
if (l <= s.length) { if (l <= s.length) {

View File

@@ -73,10 +73,11 @@ window.teaweb = {
// 加载 // 加载
if (typeof Pikaday == "undefined") { if (typeof Pikaday == "undefined") {
let that = this let that = this
this.loadJS("/js/moment.min.js") this.loadJS("/js/moment.min.js", function () {
this.loadJS("/js/pikaday.js", function () { that.loadJS("/js/pikaday.js", function () {
that.datepicker(element, callback) that.datepicker(element, callback)
}) })
})
this.loadCSS("/js/pikaday.css") this.loadCSS("/js/pikaday.css")
this.loadCSS("/js/pikaday.theme.css") this.loadCSS("/js/pikaday.theme.css")
this.loadCSS("/js/pikaday.triangle.css") this.loadCSS("/js/pikaday.triangle.css")