Skip to content

Commit

Permalink
fdb list: Ignore year/month if date present
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisspyB committed Feb 10, 2025
1 parent ae6cb95 commit 8e85094
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/gribjump/Lister.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ std::string fdbkeyToStr(const fdb5::Key& key) {
std::stringstream ss;
std::string separator = "";
std::set<std::string> keys = key.keys();

// Special case: If date is present, ignore year and month.
if (keys.find("date") != keys.end()) {
keys.erase("year");
keys.erase("month");
}

for(const auto& k : keys) {
ss << separator << k << "=" << key.get(k);
separator = ",";
Expand Down

0 comments on commit 8e85094

Please sign in to comment.