forked from ScoDoc/ScoDoc
Assiduites : Calendrier date_pivot
This commit is contained in:
parent
33c9a606b0
commit
38ba20aef6
@ -1476,3 +1476,14 @@ def is_assiduites_module_forced(
|
|||||||
except (TypeError, ValueError):
|
except (TypeError, ValueError):
|
||||||
retour = sco_preferences.get_preference("forcer_module", dept_id=dept_id)
|
retour = sco_preferences.get_preference("forcer_module", dept_id=dept_id)
|
||||||
return retour
|
return retour
|
||||||
|
|
||||||
|
|
||||||
|
def get_assiduites_time_config(config_type: str) -> str:
|
||||||
|
from app.models import ScoDocSiteConfig
|
||||||
|
match config_type:
|
||||||
|
case "matin":
|
||||||
|
return ScoDocSiteConfig.get("assi_morning_time", "08:00:00")
|
||||||
|
case "aprem":
|
||||||
|
return ScoDocSiteConfig.get("assi_afternoon_time", "18:00:00")
|
||||||
|
case "pivot":
|
||||||
|
return ScoDocSiteConfig.get("assi_lunch_time", "13:00:00")
|
||||||
|
@ -343,6 +343,9 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
const datePivot = "{{scu.get_assiduites_time_config("pivot")}}".split(":").map((el) => Number(el))
|
||||||
|
|
||||||
function getDaysBetweenDates(start, end) {
|
function getDaysBetweenDates(start, end) {
|
||||||
let now = new Date(start);
|
let now = new Date(start);
|
||||||
end = new Date(end);
|
end = new Date(end);
|
||||||
@ -476,7 +479,7 @@
|
|||||||
const matin = [new Date(date), new Date(date)]
|
const matin = [new Date(date), new Date(date)]
|
||||||
color = "sans_etat"
|
color = "sans_etat"
|
||||||
matin[0].setHours(0, 0, 0, 0)
|
matin[0].setHours(0, 0, 0, 0)
|
||||||
matin[1].setHours(12, 59, 59) // TODO Utiliser heure pivot (config)
|
matin[1].setHours(...datePivot)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -515,7 +518,8 @@
|
|||||||
span_aprem.classList.add("color");
|
span_aprem.classList.add("color");
|
||||||
const aprem = [new Date(date), new Date(date)]
|
const aprem = [new Date(date), new Date(date)]
|
||||||
color = "sans_etat"
|
color = "sans_etat"
|
||||||
aprem[0].setHours(13, 0, 0, 0) // TODO Utiliser heure pivot (config)
|
aprem[0].setHours(...datePivot)
|
||||||
|
aprem[0].add(1, "seconds")
|
||||||
aprem[1].setHours(23, 59, 59)
|
aprem[1].setHours(23, 59, 59)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user