On ajoute la ligne now à la fin
This commit is contained in:
		@@ -117,15 +117,23 @@ class DayInCalendar:
 | 
			
		||||
            if e.start_time is None
 | 
			
		||||
            else e.start_time
 | 
			
		||||
        )
 | 
			
		||||
        self.today_night = False
 | 
			
		||||
        if self.is_today():
 | 
			
		||||
            self.today_night = True
 | 
			
		||||
            now = timezone.now()
 | 
			
		||||
            nday = now.date()
 | 
			
		||||
            ntime = now.time()
 | 
			
		||||
            found = False
 | 
			
		||||
            for idx,e in enumerate(self.events):
 | 
			
		||||
                if (nday < e.start_day) or (nday == e.start_day and e.start_time and ntime <= e.start_time):
 | 
			
		||||
                    self.events[idx].is_first_after_now = True
 | 
			
		||||
                    found = True
 | 
			
		||||
                    break
 | 
			
		||||
            if found:
 | 
			
		||||
                self.today_night = False
 | 
			
		||||
 | 
			
		||||
    def is_today_after_events(self):
 | 
			
		||||
        return self.is_today() and self.today_night
 | 
			
		||||
 | 
			
		||||
    def events_by_category_ordered(self):
 | 
			
		||||
        from .models import Category
 | 
			
		||||
 
 | 
			
		||||
@@ -150,6 +150,9 @@
 | 
			
		||||
                    </dialog>
 | 
			
		||||
                </li>
 | 
			
		||||
                {% endfor %}
 | 
			
		||||
                {% if day.is_today_after_events %}
 | 
			
		||||
                <li class="line-now"><div><div>{% now "H:i" %}</div><div class="line"></div></div></li>
 | 
			
		||||
                {% endif %}
 | 
			
		||||
                </ul>
 | 
			
		||||
            {% endif %}
 | 
			
		||||
        </ul>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user