mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-16 22:42:16 +00:00
rewrote findlatestTerminWithUpload sort to guarantee sorting by abgabedatum DESC
This commit is contained in:
@@ -1798,7 +1798,7 @@ export const AbgabetoolAssistenz = {
|
||||
}
|
||||
|
||||
const latestTerminWithUpload = this.findLatestTerminWithUpload(projekt)
|
||||
|
||||
|
||||
return {
|
||||
...projekt,
|
||||
abgabetermine: projekt.abgabetermine,
|
||||
@@ -1820,8 +1820,10 @@ export const AbgabetoolAssistenz = {
|
||||
})
|
||||
},
|
||||
findLatestTerminWithUpload(projekt) {
|
||||
const withAbgabedatumSorted = projekt?.abgabetermine?.filter(t => t.abgabedatum != null)?.sort((a,b) => a < b)
|
||||
|
||||
const withAbgabedatumSorted = projekt?.abgabetermine
|
||||
?.filter(t => t.abgabedatum != null)
|
||||
?.sort((a, b) => new Date(b.abgabedatum) - new Date(a.abgabedatum));
|
||||
|
||||
if(withAbgabedatumSorted.length) {
|
||||
return withAbgabedatumSorted[0]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user