On ajoute la ligne now à la fin
This commit is contained in:
parent
6e8f00ccbe
commit
c91cdf0c99
@ -117,15 +117,23 @@ class DayInCalendar:
|
|||||||
if e.start_time is None
|
if e.start_time is None
|
||||||
else e.start_time
|
else e.start_time
|
||||||
)
|
)
|
||||||
|
self.today_night = False
|
||||||
if self.is_today():
|
if self.is_today():
|
||||||
|
self.today_night = True
|
||||||
now = timezone.now()
|
now = timezone.now()
|
||||||
nday = now.date()
|
nday = now.date()
|
||||||
ntime = now.time()
|
ntime = now.time()
|
||||||
|
found = False
|
||||||
for idx,e in enumerate(self.events):
|
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):
|
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
|
self.events[idx].is_first_after_now = True
|
||||||
|
found = True
|
||||||
break
|
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):
|
def events_by_category_ordered(self):
|
||||||
from .models import Category
|
from .models import Category
|
||||||
|
@ -150,6 +150,9 @@
|
|||||||
</dialog>
|
</dialog>
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% 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>
|
</ul>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user