Skip to content

Commit c8c0b32

Browse files
committed
fix date format bug with ds dashboard charts
1 parent 786ed91 commit c8c0b32

File tree

1 file changed

+3
-3
lines changed
  • web/src/apps/workflows/module/dispatch/dashboard

1 file changed

+3
-3
lines changed

web/src/apps/workflows/module/dispatch/dashboard/index.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,12 @@ export default {
141141
if (this.daySelected === 1) {
142142
tYear = dd.getFullYear(),
143143
tMonth = dd.getMonth() + 1 > 9 ? dd.getMonth() + 1 : '0' + (dd.getMonth() + 1),
144-
tDay = dd.getDate()
144+
tDay = dd.getDate() > 9 ? dd.getDate() : '0' + dd.getDate()
145145
} else if (this.daySelected === 2) {
146146
dd.setDate(dd.getDate() - 1)
147147
tYear = dd.getFullYear(),
148148
tMonth = dd.getMonth() + 1 > 9 ? dd.getMonth() + 1 : '0' + (dd.getMonth() + 1),
149-
tDay = dd.getDate()
149+
tDay = dd.getDate() > 9 ? dd.getDate() : '0' + dd.getDate()
150150
}
151151
if (this.daySelected) {
152152
this.getMixedBarLineData(`${tYear}-${tMonth}-${tDay}`, (dd) => {
@@ -249,7 +249,7 @@ export default {
249249
function getFormatDateString(dd) {
250250
let tYear = dd.getFullYear(),
251251
tMonth = dd.getMonth() + 1 > 9 ? dd.getMonth() + 1 : '0' + (dd.getMonth() + 1),
252-
tDay = dd.getDate()
252+
tDay = dd.getDate() > 9 ? dd.getDate() : '0' + dd.getDate()
253253
return `${tYear}-${tMonth}-${tDay}`
254254
}
255255
if (!this.projectName) return

0 commit comments

Comments
 (0)