mirror of
https://github.com/Garmelon/Arbeitszeitdokumentationsgenerator.git
synced 2026-04-12 08:45:05 +02:00
Add template option to sort entries chronologically
This commit is contained in:
parent
55b21c28e6
commit
d30cd79229
2 changed files with 8 additions and 0 deletions
|
|
@ -507,6 +507,7 @@
|
|||
monthly_hours: 40,
|
||||
hourly_wage: [14.09],
|
||||
validate: true,
|
||||
sort: true,
|
||||
carry_prev_month: "00:00",
|
||||
year: 2024,
|
||||
month: 1,
|
||||
|
|
@ -521,6 +522,10 @@
|
|||
entries = entries.pos()
|
||||
assert(entries.len() <= _kit_rows, message: "at most " + str(_kit_rows) + " entries allowed")
|
||||
|
||||
if sort {
|
||||
entries = entries.sorted(key: entry => (entry.day, entry.end, entry.start))
|
||||
}
|
||||
|
||||
let monthly = monthly_hours * 60
|
||||
let holiday = entries.filter(e => e.note == notes.Urlaub).map(e => e.duration).sum(default: 0)
|
||||
let total = entries.map(e => e.duration).sum(default: 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue