sco_gen_cal : ajout style semaine courante

This commit is contained in:
Iziram 2024-05-13 15:38:56 +02:00
parent a4db8c4ff8
commit fa6f83722e
2 changed files with 16 additions and 0 deletions

View File

@ -20,8 +20,11 @@ class Jour:
def __init__(self, date: datetime.date):
self.date = date
self.class_list: list[str] = []
if self.is_non_work():
self.class_list.append("non-travail")
if self.is_current_week():
self.class_list.append("sem-courante")
def get_nom(self, short=True):
"""
@ -45,6 +48,12 @@ class Jour:
dept_id=g.scodoc_dept_id
)
def is_current_week(self):
"""
Renvoie True si le jour est dans la semaine courante
"""
return self.date.isocalendar()[1] == datetime.date.today().isocalendar()[1]
def get_date(self) -> str:
"""
Renvoie la date du jour au format "dd/mm/yyyy"

View File

@ -69,4 +69,11 @@
border: 1px solid #d5d5d5;
position: relative;
}
.sem-courante{
--couleur : #ee752c;
border-left: solid 3px var(--couleur);
border-right: solid 3px var(--couleur);
}
</style>