mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-25 21:39:21 +00:00
Can add events
This commit is contained in:
parent
1adf0fb872
commit
d7779bd653
@ -37,6 +37,8 @@ class GroupPresencePage {
|
||||
}
|
||||
})
|
||||
|
||||
let lastClick = null;
|
||||
|
||||
const calendarTarget = el.querySelector(".calendar");
|
||||
const calendar = new FullCalendar.Calendar(calendarTarget, {
|
||||
headerToolbar: {
|
||||
@ -55,6 +57,22 @@ class GroupPresencePage {
|
||||
console.error(e);
|
||||
notify(tr("Failed to update presence!"), "danger")
|
||||
}
|
||||
},
|
||||
|
||||
// Add new event
|
||||
dateClick: async function(info) {
|
||||
if (lastClick == null || new Date().getTime() - lastClick.getTime() > 500)
|
||||
{
|
||||
lastClick = new Date()
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await ForezPresenceHelper.AddDay(group.id, info.date.getFullYear(), info.date.getMonth() + 1, info.date.getDate())
|
||||
} catch(e) {
|
||||
console.error(e);
|
||||
notify(tr("Failed to update presence!"), "danger")
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
</div>
|
||||
<div class="box-body">
|
||||
|
||||
<p>tr("Double-click to add or remove days of presence")</p>
|
||||
|
||||
<div class="calendar"></div>
|
||||
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user