added: parameter to display recent changes only
This commit is contained in:
		
							parent
							
								
									fc1b357bf3
								
							
						
					
					
						commit
						aa967da857
					
				
							
								
								
									
										4
									
								
								ics.php
								
								
								
								
							
							
						
						
									
										4
									
								
								ics.php
								
								
								
								
							| 
						 | 
				
			
			@ -100,6 +100,8 @@ function showresult()
 | 
			
		|||
			recent = 7;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		var recentonly = params.get("recentonly");
 | 
			
		||||
 | 
			
		||||
		var html = "<h1>Evénements à venir</h1>";
 | 
			
		||||
		html += `<h3>${formatdate(new Date)}</h3>`;
 | 
			
		||||
		html += `<div>En gras: modifié les ${recent} derniers jours</div>`;
 | 
			
		||||
| 
						 | 
				
			
			@ -117,7 +119,7 @@ function showresult()
 | 
			
		|||
		var group = {};
 | 
			
		||||
 | 
			
		||||
		o.VEVENTS
 | 
			
		||||
		.filter(e => e.DTSTART >= (new Date))
 | 
			
		||||
		.filter(e => e.DTSTART >= (new Date) && (!recentonly || e.DTSTAMP >= lastmodified))
 | 
			
		||||
		.sort( (a,b) => a.DTSTART - b.DTSTART)
 | 
			
		||||
		.forEach(e => {
 | 
			
		||||
			var formatteddate = formatdate(e.DTSTART);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue