P-51
This commit is contained in:
1 parent
f9fae62ae6
commit
13bdc5ab3f
1 file changed
+15
-4
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<v-locale-provider locale="ru">
|
||||
{{ selectDay }}
|
||||
<v-calendar
|
||||
ref="calendar"
|
||||
:events="events"
|
||||
@@ -112,7 +111,13 @@ export default {
|
||||
const selectDay = ref(new Date());
|
||||
const monthNow = ref(new Date().getMonth());
|
||||
const YearNow = ref(new Date().getFullYear());
|
||||
const endWeek = computed({
|
||||
get() {
|
||||
return 8 - new Date(selectDay.value).getDay();
|
||||
},
|
||||
});
|
||||
|
||||
// const endWeek = ref();
|
||||
const events = [
|
||||
{
|
||||
title: "Крот",
|
||||
@@ -131,12 +136,18 @@ export default {
|
||||
monthNow.value = 11;
|
||||
YearNow.value -= 1;
|
||||
}
|
||||
} else {
|
||||
} else if (type.value == "day") {
|
||||
selectDay.value = new Date(
|
||||
new Date(selectDay.value).setDate(
|
||||
new Date(selectDay.value).getDate() - 1
|
||||
)
|
||||
);
|
||||
} else {
|
||||
selectDay.value = new Date(
|
||||
new Date(selectDay.value).setDate(
|
||||
new Date(selectDay.value).getDate() - endWeek.value
|
||||
)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -157,7 +168,7 @@ export default {
|
||||
} else {
|
||||
selectDay.value = new Date(
|
||||
new Date(selectDay.value).setDate(
|
||||
new Date(selectDay.value).getDate() + 4
|
||||
new Date(selectDay.value).getDate() + endWeek.value
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -166,7 +177,7 @@ export default {
|
||||
const todayDay = () => {
|
||||
monthNow.value = new Date().getMonth();
|
||||
YearNow.value = new Date().getFullYear();
|
||||
selectDay.value = new Date()
|
||||
selectDay.value = new Date();
|
||||
};
|
||||
|
||||
const getMonthName = (monthNumber) => {
|
||||
|
||||
Reference in new issue
Block a user