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