mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-04 12:14:12 +00:00 
			
		
		
		
	Can add events
This commit is contained in:
		@@ -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>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user