update 待办日历bug修复
This commit is contained in:
@@ -18,6 +18,11 @@ export default {
|
||||
transparent
|
||||
borderless
|
||||
expanded
|
||||
:initial-page="{
|
||||
month: new Date().getMonth(),
|
||||
year: new Date().getFullYear(),
|
||||
week: new Date().getWeek() + 1,
|
||||
}"
|
||||
@did-move="weeknumberClick"
|
||||
@dayclick="dayClick"
|
||||
/>
|
||||
@@ -74,6 +79,13 @@ const locale = computed(() => {
|
||||
const masks = ref({
|
||||
weekdays: 'WWW',
|
||||
});
|
||||
Date.prototype.getWeek = function () {
|
||||
const date = new Date(this.getTime());
|
||||
date.setHours(0, 0, 0, 0);
|
||||
date.setDate(date.getDate() + 3 - ((date.getDay() + 6) % 7));
|
||||
const week1 = new Date(date.getFullYear(), 0, 4);
|
||||
return 1 + Math.round(((date.getTime() - week1.getTime()) / 86400000 - 3 + ((week1.getDay() + 6) % 7)) / 7);
|
||||
};
|
||||
|
||||
const reminders = ref([]);
|
||||
const calendar = ref(null);
|
||||
|
||||
Reference in New Issue
Block a user