mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-04 04:04:20 +00:00 
			
		
		
		
	Process dates
This commit is contained in:
		@@ -24,19 +24,6 @@ class GroupPresencePage {
 | 
			
		||||
        target.appendChild(el);
 | 
			
		||||
        
 | 
			
		||||
        
 | 
			
		||||
        Vue.createApp({
 | 
			
		||||
            
 | 
			
		||||
            data: () => {
 | 
			
		||||
                return {
 | 
			
		||||
                    
 | 
			
		||||
                }
 | 
			
		||||
            },
 | 
			
		||||
            
 | 
			
		||||
            methods: {
 | 
			
		||||
            }
 | 
			
		||||
            
 | 
			
		||||
        }).mount(el);
 | 
			
		||||
        
 | 
			
		||||
        
 | 
			
		||||
        const calEvents = presence.map((e) => {
 | 
			
		||||
            return {
 | 
			
		||||
@@ -44,7 +31,7 @@ class GroupPresencePage {
 | 
			
		||||
                start: new Date(e.year, e.month - 1, e.day),
 | 
			
		||||
                backgroundColor: "#0073b7", //Blue
 | 
			
		||||
                borderColor: "#0073b7", //Blue
 | 
			
		||||
                editable: false,
 | 
			
		||||
                editable: e.userID == userID(),
 | 
			
		||||
                allDay: true,
 | 
			
		||||
                description: users.get(e.userID).fullName
 | 
			
		||||
            }
 | 
			
		||||
@@ -59,6 +46,22 @@ class GroupPresencePage {
 | 
			
		||||
            },
 | 
			
		||||
            initialView: 'dayGridMonth',
 | 
			
		||||
            events: calEvents,
 | 
			
		||||
 | 
			
		||||
            // Update events
 | 
			
		||||
            eventResize: function(info) {
 | 
			
		||||
                const newDays = new Set(getDaysOfRange(info.event.start, info.event.end).map(el => el.getTime()));
 | 
			
		||||
                const oldDays = new Set(getDaysOfRange(info.oldEvent.start, info.oldEvent.end).map(el => el.getTime()));
 | 
			
		||||
 | 
			
		||||
                for (const el of newDays) {
 | 
			
		||||
                    if(oldDays.has(el)) {
 | 
			
		||||
                        newDays.delete(el)
 | 
			
		||||
                        oldDays.delete(el)
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                console.info("add", newDays)
 | 
			
		||||
                console.info("del", oldDays)
 | 
			
		||||
            }
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        calendar.render()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user