Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/sites/demos/pc/app/date-panel/basic-usage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<div class="value">{{ value }}</div>
<tiny-date-panel v-model="value"></tiny-date-panel>
<div class="month">{{ month }}</div>
<tiny-date-panel v-model="value" type="month"></tiny-date-panel>
<tiny-date-panel v-model="month" type="month"></tiny-date-panel>
<div class="year">{{ year }}</div>
<tiny-date-panel v-model="value" type="year"></tiny-date-panel>
<tiny-date-panel v-model="year" type="year"></tiny-date-panel>
<div class="value1">{{ value1 }}</div>
<tiny-date-range type="daterange" v-model="value1"></tiny-date-range>
<div class="value2">{{ value2 }}</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/renderless/src/date-panel/vue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ const initWatch = ({ watch, state, api, nextTick, props }) => {
newVal = toDate1(val - localOffset)
}
if (newVal) {
const newDate = modifyDate(newVal, newVal.getFullYear(), newVal.getMonth(), newVal.getUTCDate() + 1)
const newDate = modifyDate(newVal, newVal.getFullYear(), newVal.getMonth(), newVal.getUTCDate())
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这样在某些情况下会导致选中日期提前一天,可将getUTCDate 修改为getDate

state.date = newDate
state.value = newDate
}
Expand Down
2 changes: 1 addition & 1 deletion packages/theme/src/date-table/vars.less
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
// 单元格宽度度
--tv-DateTable-td-div-width: 28px;
// 单元格顶部间距
--tv-DateTable-td-span-top: 4px;
--tv-DateTable-td-span-top: 3px;
// 开始日期圆角
--tv-DateTable-start-date-border-radius: var(--tv-border-radius-brand, 999px);
// 选中日期圆角
Expand Down
Loading