HTML generator: Sort by date.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
2e164316dd
commit
cfb79577ae
|
@ -19,6 +19,7 @@
|
||||||
#include "json.hpp"
|
#include "json.hpp"
|
||||||
#include "types.hpp"
|
#include "types.hpp"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
@ -32,6 +33,7 @@ namespace FediBlock::files
|
||||||
using std::getenv;
|
using std::getenv;
|
||||||
using std::ifstream;
|
using std::ifstream;
|
||||||
using std::runtime_error;
|
using std::runtime_error;
|
||||||
|
using std::sort;
|
||||||
using std::string;
|
using std::string;
|
||||||
using std::stringstream;
|
using std::stringstream;
|
||||||
using std::uintmax_t;
|
using std::uintmax_t;
|
||||||
|
@ -138,6 +140,11 @@ vector<entry_type> read_json_files()
|
||||||
entries.push_back(entry);
|
entries.push_back(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
|
sort(entries.begin(), entries.end(), [](const auto &a, const auto &b)
|
||||||
|
{ return a.report_time > b.report_time; }); // Newest first.
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
return entries;
|
return entries;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user