Skip to content

Commit

Permalink
Ref #8 Sorting reports by last added date
Browse files Browse the repository at this point in the history
Signed-off-by: Krzysztof Kaźmierczyk <kazm@ibm.com>
  • Loading branch information
kkazmierczyk committed Oct 31, 2024
1 parent ac7fd99 commit 79cfdae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion javacore_analyser_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@

@app.route('/')
def index():
reports = [{"name": Path(f).name, "date": time.ctime(os.path.getctime(f))}
reports = [{"name": Path(f).name, "date": time.ctime(os.path.getctime(f)), "timestamp": os.path.getctime(f)}
for f in os.scandir(reports_dir) if f.is_dir()]
reports.sort(key=lambda item: item["timestamp"], reverse=True)
return render_template('index.html', reports=reports)


Expand Down

0 comments on commit 79cfdae

Please sign in to comment.