This commit is contained in:
2021-09-15 15:21:43 +00:00
parent 736cdddad2
commit 97451f31a0

View File

@@ -66,10 +66,8 @@
@change="fetchEvents" @change="fetchEvents"
> >
<template v-slot:event="{ event }"> <template v-slot:event="{ event }">
<v-icon small :color="getContrastYIQ(event.color)">$ayiTools</v-icon> <v-icon small :color="event.textColor">$ayiTools</v-icon>
<span :class="getContrastYIQ(event.color) + '--text'">{{ <span :class="event.textColor + '--text'">{{ event.name }}</span>
event.name
}}</span>
</template> </template>
</v-calendar> </v-calendar>
@@ -242,14 +240,14 @@ export default {
this.$refs.calendar.checkChange(); this.$refs.calendar.checkChange();
}, },
methods: { methods: {
getContrastYIQ(hexcolor) { // getContrastYIQ(hexcolor) {
hexcolor = hexcolor.replace("#", ""); // hexcolor = hexcolor.replace("#", "");
var r = parseInt(hexcolor.substr(0, 2), 16); // var r = parseInt(hexcolor.substr(0, 2), 16);
var g = parseInt(hexcolor.substr(2, 2), 16); // var g = parseInt(hexcolor.substr(2, 2), 16);
var b = parseInt(hexcolor.substr(4, 2), 16); // var b = parseInt(hexcolor.substr(4, 2), 16);
var yiq = (r * 299 + g * 587 + b * 114) / 1000; // var yiq = (r * 299 + g * 587 + b * 114) / 1000;
return yiq >= 128 ? "black" : "white"; // return yiq >= 128 ? "black" : "white";
}, // },
onResize() { onResize() {
this.calendarHeight = window.innerHeight * 0.84; this.calendarHeight = window.innerHeight * 0.84;
}, },
@@ -327,6 +325,7 @@ export default {
window.$gz.form.deleteAllErrorBoxErrors(this); window.$gz.form.deleteAllErrorBoxErrors(this);
let res = await window.$gz.api.post("schedule/personal", { let res = await window.$gz.api.post("schedule/personal", {
view: v,
start: window.$gz.locale.localTimeDateStringToUTC8601String( start: window.$gz.locale.localTimeDateStringToUTC8601String(
`${start.date}T00:00:00`, `${start.date}T00:00:00`,
this.timeZoneName this.timeZoneName