Add today date
This commit is contained in:
parent
bfee37b631
commit
64b1083619
|
@ -157,13 +157,7 @@ const onAbsencesFetched = (data) => {
|
|||
console.log('events:: ', events);
|
||||
};
|
||||
|
||||
watch(selectedYear, () => {
|
||||
refreshData();
|
||||
});
|
||||
|
||||
watch(selectedBusinessFk, () => {
|
||||
refreshData();
|
||||
});
|
||||
watch([selectedYear, selectedBusinessFk], () => refreshData());
|
||||
|
||||
defineExpose({
|
||||
refreshData,
|
||||
|
|
|
@ -45,8 +45,9 @@ const { locale } = useI18n();
|
|||
|
||||
const calendarRef = ref(null);
|
||||
const weekdayStore = useWeekdayStore();
|
||||
const selectedDate = ref(null);
|
||||
const selectedDate = ref();
|
||||
const calendarEventDates = [];
|
||||
const today = ref(date.formatDate(Date.vnNew(), 'YYYY-MM-DD'));
|
||||
|
||||
const updateSelectedDate = (year) => {
|
||||
const _date = new Date(year, props.month - 1, 1);
|
||||
|
@ -99,13 +100,13 @@ const handleDateSelected = (date) => {
|
|||
};
|
||||
|
||||
const getEventByTimestamp = ({ year, month, day }) => {
|
||||
const stamp = date.formatDate(new Date(year, month - 1, day), 'x');
|
||||
const stamp = new Date(year, month - 1, day).getTime();
|
||||
return props.events[stamp] || null;
|
||||
};
|
||||
|
||||
const getEventAttrs = (timestamp) => {
|
||||
const event = getEventByTimestamp(timestamp);
|
||||
if (!event) return '';
|
||||
if (!event) return {};
|
||||
|
||||
const { name, color } = event;
|
||||
return {
|
||||
|
@ -142,6 +143,7 @@ watch(props.year, (newValue) => {
|
|||
:weekdays="[1, 2, 3, 4, 5, 6, 0]"
|
||||
:disabled-weekdays="[0, 6]"
|
||||
:locale="locale"
|
||||
:now="today"
|
||||
mini-mode
|
||||
>
|
||||
<template #day="{ scope: { timestamp } }">
|
||||
|
|
Loading…
Reference in New Issue