Browse Source

修复日期格式问题

master
1191151619 4 years ago
parent
commit
a28f19c688
  1. 8
      components/ui-calendar/ui-calendar.wxss
  2. 4
      pages/calendar/calendar.js

8
components/ui-calendar/ui-calendar.wxss

@ -14,16 +14,16 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin: 12rpx; margin: 12rpx;
width: 76rpx; width: 74rpx;
height: 76rpx; height: 74rpx;
box-sizing: border-box; box-sizing: border-box;
} }
.item .item_view { .item .item_view {
display: flex !important; display: flex !important;
align-items: center !important; align-items: center !important;
justify-content: center !important; justify-content: center !important;
width: 76rpx !important; width: 74rpx !important;
height: 76rpx !important; height: 74rpx !important;
box-sizing: border-box !important; box-sizing: border-box !important;
} }

4
pages/calendar/calendar.js

@ -125,8 +125,10 @@ Page({
onShow: function () { onShow: function () {
let demo = wx.getStorageSync("date"); let demo = wx.getStorageSync("date");
let timer = this.data.timer; let timer = this.data.timer;
let getDate = new Date().getDate();
if (!timer) { if (!timer) {
timer = this.data.calendarDisplayTime + '-' + new Date().getDate(); getDate = getDate>9?getDate:'0'+getDate
timer = this.data.calendarDisplayTime + '-' + getDate;
} }
if (demo) { if (demo) {
timer = demo.time timer = demo.time

Loading…
Cancel
Save