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