修改日期默认为当前时间
选择全天之后不会更改时间选项
This commit is contained in:
parent
6963de62ea
commit
f74b838fd2
|
|
@ -31,7 +31,7 @@
|
|||
</view>
|
||||
<text class="arrow">›</text>
|
||||
</view>
|
||||
<text class="time-separator">→</text>
|
||||
<text class="time-separator">----</text>
|
||||
<view class="time-item" @click="openEndPicker">
|
||||
<view class="time-icon">🕐</view>
|
||||
<view class="time-content">
|
||||
|
|
@ -416,7 +416,7 @@ const initDates = (dateStr = '') => {
|
|||
if (!formData.value.allDay) {
|
||||
const today = new Date();
|
||||
formData.value.startHour = today.getHours();
|
||||
formData.value.startMin = Math.ceil(today.getMinutes() / 5) * 5; // 向上取整到5的倍数
|
||||
formData.value.startMin = today.getMinutes();
|
||||
const endTime = new Date(today);
|
||||
endTime.setHours(today.getHours() + 1);
|
||||
formData.value.endHour = endTime.getHours();
|
||||
|
|
@ -507,14 +507,14 @@ function formatDateToYYYYMMDD(dateInput) {
|
|||
// 切换全天
|
||||
const toggleAllDay = () => {
|
||||
formData.value.allDay = !formData.value.allDay;
|
||||
if (formData.value.allDay) {
|
||||
formData.value.startHour = 0;
|
||||
formData.value.startMin = 0;
|
||||
formData.value.endHour = 23;
|
||||
formData.value.endMin = 59;
|
||||
startPickerIndex.value = [0, 0];
|
||||
endPickerIndex.value = [23, 59];
|
||||
}
|
||||
// if (formData.value.allDay) {
|
||||
// formData.value.startHour = 0;
|
||||
// formData.value.startMin = 0;
|
||||
// formData.value.endHour = 23;
|
||||
// formData.value.endMin = 59;
|
||||
// startPickerIndex.value = [0, 0];
|
||||
// endPickerIndex.value = [23, 59];
|
||||
// }
|
||||
};
|
||||
|
||||
// 选择颜色
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user