From 316a02fa2f5937095bed3da1f8c3086fdfd11cf3 Mon Sep 17 00:00:00 2001 From: aceberg <1502200+aceberg@users.noreply.github.com> Date: Fri, 30 Aug 2024 01:22:45 +0700 Subject: [PATCH] History in DB switch --- internal/web/public/js/hist-html.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/web/public/js/hist-html.js b/internal/web/public/js/hist-html.js index 2bd97d2..c05b547 100644 --- a/internal/web/public/js/hist-html.js +++ b/internal/web/public/js/hist-html.js @@ -1,6 +1,8 @@ function getHistHTML(hist) { + hist = sortHistByDate(hist); + let html = '', col, title; for (let h of hist) { @@ -17,4 +19,11 @@ function getHistHTML(hist) { `; } return html; +} + +function sortHistByDate(hist) { + + hist.sort((a, b) => (a.Date > b.Date)); + + return hist; } \ No newline at end of file