fix calendar layout style

This commit is contained in:
Timi
2025-12-10 14:20:21 +08:00
parent 4f1942f3f0
commit ad755c7d0e
2 changed files with 7 additions and 8 deletions

View File

@ -3,13 +3,13 @@
flex: 1;
height: 100%;
display: flex;
padding: 32rpx;
overflow: hidden;
flex-direction: column;
.year {
display: flex;
padding: 16rpx 0;
padding: 16rpx 32rpx;
background: var(--theme-bg-secondary);
align-items: center;
margin-bottom: 24rpx;
justify-content: space-between;
@ -18,7 +18,6 @@
width: 64rpx;
height: 64rpx;
display: flex;
background: var(--theme-bg-card);
align-items: center;
border-radius: 12rpx;
justify-content: center;
@ -37,6 +36,7 @@
.weekdays {
display: grid;
padding: 0 32rpx;
margin-bottom: 16rpx;
grid-template-columns: repeat(7, 1fr);
@ -54,14 +54,13 @@
padding-bottom: 256rpx;
.month {
margin-bottom: 48rpx;
padding: 0 32rpx;
.title {
color: var(--theme-text);
padding: 16rpx 0;
font-size: 28rpx;
margin-top: 32rpx;
font-weight: 600;
margin-bottom: 16rpx;
}
.days {

View File

@ -143,8 +143,8 @@ Component({
});
}
// 下个月需要显示的日期(补齐到 42 个格子6 行)
const remainingDays = 42 - days.length;
// 下个月需要显示的日期(补齐到 35 个格子6 行)
const remainingDays = 35 - days.length;
for (let day = 1; day <= remainingDays; day++) {
const nextMonth = month === 12 ? 1 : month + 1;
const nextYear = month === 12 ? year + 1 : year;