P-47 all day complete
This commit is contained in:
1 parent
5c77ef4747
commit
dac26595fc
4 files changed
+61
-33
No files matched your search
@@ -119,8 +119,8 @@ export default {
|
|||||||
const MyMonth = ref(selectdate.value.getMonth() + 1);
|
const MyMonth = ref(selectdate.value.getMonth() + 1);
|
||||||
const calendarForMy = ref([]);
|
const calendarForMy = ref([]);
|
||||||
const eventFromCalendar = ref({})
|
const eventFromCalendar = ref({})
|
||||||
const idEvent = ref(null)
|
// const idEvent = ref(null)
|
||||||
// const idEvent = ref(1)
|
const idEvent = ref(1)
|
||||||
|
|
||||||
const getMonth = (month) => {
|
const getMonth = (month) => {
|
||||||
MyMonth.value = month + 1;
|
MyMonth.value = month + 1;
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-col class="pb-2 d-flex flex-column ml-n3">
|
<v-col class="pb-2 d-flex flex-column ml-n3">
|
||||||
<v-row no-gutters class="gap">
|
<v-row no-gutters class="gap">
|
||||||
<v-col >
|
<v-col>
|
||||||
<v-checkbox-btn color="indigo-darken-4" label="Весь день" />
|
<v-checkbox-btn
|
||||||
|
v-model="newDate"
|
||||||
|
color="indigo-darken-4"
|
||||||
|
label="Весь день"
|
||||||
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col></v-col>
|
<v-col></v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
@@ -10,25 +14,44 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { computed, ref } from "vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
dateEvent: {
|
dateEventStart: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {},
|
default: () => {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
setup(props, { emit }) {
|
setup(props, { emit }) {
|
||||||
console.log(props.dateEvent, 'dateEvent')
|
const chek = ref(false);
|
||||||
|
|
||||||
// const propsDateEvent = computed({
|
const newDate = computed({
|
||||||
// get: () => props.dateEvent,
|
get() {
|
||||||
// set: (value) => emit("update:dateEvent", value),
|
return chek.value;
|
||||||
// });
|
},
|
||||||
|
set(newValue) {
|
||||||
|
chek.value = newValue;
|
||||||
|
newValue == true
|
||||||
|
? (propsDateEvent.value.date_end = new Date(
|
||||||
|
new Date(propsDateEvent.value.date_start).setHours(23, 59, 0)
|
||||||
|
)) &&
|
||||||
|
(propsDateEvent.value.date_start = new Date(
|
||||||
|
new Date(propsDateEvent.value.date_start).setHours(0, 0, 0)
|
||||||
|
))
|
||||||
|
: (propsDateEvent.value.date_end = new Date());
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const propsDateEvent = computed({
|
||||||
|
get: () => props.dateEventStart,
|
||||||
|
set: (value) => emit("update:dateEventStart", value),
|
||||||
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
// propsDateEvent
|
newDate,
|
||||||
}
|
};
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ export default {
|
|||||||
setup(props, { emit }) {
|
setup(props, { emit }) {
|
||||||
const menudate = ref(false);
|
const menudate = ref(false);
|
||||||
const menutime = ref(false);
|
const menutime = ref(false);
|
||||||
const disbleTime = ref(false)
|
const disbleTime = ref(false);
|
||||||
|
|
||||||
const propsDateEvent = computed({
|
const propsDateEvent = computed({
|
||||||
get: () => props.dateEvent,
|
get: () => props.dateEvent,
|
||||||
@@ -117,16 +117,26 @@ export default {
|
|||||||
props.order[0] == 2
|
props.order[0] == 2
|
||||||
? new Date(propsDateEvent.value.date_start)
|
? new Date(propsDateEvent.value.date_start)
|
||||||
: new Date(propsDateEvent.value.date_end);
|
: new Date(propsDateEvent.value.date_end);
|
||||||
|
|
||||||
let clockStart = `${new Date(propsDateEvent.value.date_start).getHours()}:${String(
|
let clockStart = `${new Date(
|
||||||
|
propsDateEvent.value.date_start
|
||||||
|
).getHours()}:${String(
|
||||||
new Date(propsDateEvent.value.date_start).getMinutes()
|
new Date(propsDateEvent.value.date_start).getMinutes()
|
||||||
).padStart(2, "0")}`
|
).padStart(2, "0")}`;
|
||||||
let clockEnd = `${new Date(propsDateEvent.value.date_end).getHours()}:${String(
|
let clockEnd = `${new Date(
|
||||||
|
propsDateEvent.value.date_end
|
||||||
|
).getHours()}:${String(
|
||||||
new Date(propsDateEvent.value.date_end).getMinutes()
|
new Date(propsDateEvent.value.date_end).getMinutes()
|
||||||
).padStart(2, "0")}`
|
).padStart(2, "0")}`;
|
||||||
if (clockStart == '0:00' && clockEnd == "23:59" && formatDash(propsDateEvent.value.date_start) == formatDash(propsDateEvent.value.date_end)) disbleTime.value = true
|
disbleTime.value =
|
||||||
console.log(clockStart, clockEnd, formatDash(propsDateEvent.value.date_start), formatDash(propsDateEvent.value.date_end))
|
clockStart == "0:00" &&
|
||||||
return date;
|
clockEnd == "23:59" &&
|
||||||
|
formatDash(propsDateEvent.value.date_start) ==
|
||||||
|
formatDash(propsDateEvent.value.date_end)
|
||||||
|
? true
|
||||||
|
: false;
|
||||||
|
|
||||||
|
return date;
|
||||||
},
|
},
|
||||||
set(newValue) {
|
set(newValue) {
|
||||||
if (props.order[0] == 2)
|
if (props.order[0] == 2)
|
||||||
@@ -146,12 +156,7 @@ export default {
|
|||||||
props.order[0] == 2
|
props.order[0] == 2
|
||||||
? propsDateEvent.value.date_start
|
? propsDateEvent.value.date_start
|
||||||
: propsDateEvent.value.date_end;
|
: propsDateEvent.value.date_end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return `${new Date(time).getHours()}:${String(
|
return `${new Date(time).getHours()}:${String(
|
||||||
new Date(time).getMinutes()
|
new Date(time).getMinutes()
|
||||||
).padStart(2, "0")}`;
|
).padStart(2, "0")}`;
|
||||||
@@ -176,7 +181,7 @@ export default {
|
|||||||
menutime,
|
menutime,
|
||||||
formatComa,
|
formatComa,
|
||||||
timeEvent,
|
timeEvent,
|
||||||
disbleTime
|
disbleTime,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -106,8 +106,8 @@
|
|||||||
</v-row>
|
</v-row>
|
||||||
<v-row no-gutters>
|
<v-row no-gutters>
|
||||||
<period-events
|
<period-events
|
||||||
:dateEvent="propsEvent.event"
|
:dateEventStart="propsEvent.event"
|
||||||
|
@update:dateEventStart="propsEvent.event = $event"
|
||||||
/>
|
/>
|
||||||
</v-row> </v-col
|
</v-row> </v-col
|
||||||
></v-row>
|
></v-row>
|
||||||
|
|||||||
Reference in new issue
Block a user