mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-07-23 13:08:48 +02:00
fix:#30 format, lint and fixed types
This commit is contained in:
@ -18,7 +18,7 @@ const props = defineProps({
|
||||
type: Date,
|
||||
required: false,
|
||||
default: null,
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
type CalenderEvent = {
|
||||
@ -28,7 +28,7 @@ type CalenderEvent = {
|
||||
showFree: boolean;
|
||||
};
|
||||
|
||||
const propDate: Ref<Date|null> = ref(props.date);
|
||||
const propDate: Ref<Date | null> = ref(props.date);
|
||||
|
||||
const currentDateFrom: Ref<string> = ref("");
|
||||
const currentDateTo: Ref<string> = ref("");
|
||||
@ -131,14 +131,13 @@ const calendarOptions: ComputedRef<CalendarOptions> = computed(() => ({
|
||||
},
|
||||
|
||||
datesSet: function (dateInfo: DatesSetArg) {
|
||||
|
||||
if(propDate.value !== null) {
|
||||
if (propDate.value !== null) {
|
||||
console.debug("props.date: ", props.date);
|
||||
const date = new Date(props.date);
|
||||
|
||||
// calculate the week start and end date which includes the date
|
||||
const weekStart = new Date(date);
|
||||
weekStart.setDate(date.getDate() - date.getDay()+1);
|
||||
weekStart.setDate(date.getDate() - date.getDay() + 1);
|
||||
const weekEnd = new Date(date);
|
||||
weekEnd.setDate(date.getDate() - date.getDay() + 6);
|
||||
currentDateFrom.value = weekStart.toISOString().split("T")[0];
|
||||
@ -147,7 +146,9 @@ const calendarOptions: ComputedRef<CalendarOptions> = computed(() => ({
|
||||
} else {
|
||||
const view = dateInfo.view;
|
||||
const offset = new Date().getTimezoneOffset();
|
||||
const startDate = new Date(view.activeStart.getTime() - offset * 60 * 1000);
|
||||
const startDate = new Date(
|
||||
view.activeStart.getTime() - offset * 60 * 1000,
|
||||
);
|
||||
const endDate = new Date(view.activeEnd.getTime() - offset * 60 * 1000);
|
||||
currentDateFrom.value = startDate.toISOString().split("T")[0];
|
||||
currentDateTo.value = endDate.toISOString().split("T")[0];
|
||||
|
Reference in New Issue
Block a user