From 8f8ca7cc0ed420f3ee1fe0e672df4cc8a042ecf9 Mon Sep 17 00:00:00 2001 From: zlg Date: Sat, 2 Aug 2025 23:33:12 -0700 Subject: vgstash-web: Include dates on default view displays All views now feature some way to represent the Purchase, Beaten, and Completion dates for games. --- src/vgstash/web/vgstash.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/vgstash/web/vgstash.js b/src/vgstash/web/vgstash.js index 1b4046e..5f2fab7 100644 --- a/src/vgstash/web/vgstash.js +++ b/src/vgstash/web/vgstash.js @@ -66,6 +66,13 @@ function data_loaded(evt) { render(anchor, filter_vgs(gamecol, "all")); } +function ts_to_isodate(ts) { + if (ts == '' || ts == null) { + return ""; + } + return new Date(parseInt(ts) * 1000).toISOString().split("T")[0]; +} + function filter_vgs(vgscol, filter_name) { var new_col = new Array(); for (game in vgscol) { @@ -170,7 +177,7 @@ function render(target, vgscol) { if (current_filter == "backlog_age") { output = "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; } else { - output = "
TitleSystemOwnershipProgressYearsDays
\n\n\n\n\n\n\n\n\n\n\n\n\n"; + output = "
TitleSystemOwnershipProgress
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; } for (var game in vgscol) { var has_notes = false; @@ -191,7 +198,7 @@ function render(target, vgscol) { if (current_filter == "backlog_age") { output += "\n"; } else { - output += "\n"; + output += "\n"; } } output += "\n\n
TitleSystemOwnershipProgressPurchase DateBeaten DateCompletion Date
" + ntitle + "" + vgscol[game].system + "" + own_map[vgscol[game].ownership] + "" + prog_map[vgscol[game].progress] + "" + vgscol[game].years.toString() + "" + vgscol[game].days.toString() + "
" + ntitle + "" + vgscol[game].system + "" + own_map[vgscol[game].ownership] + "" + prog_map[vgscol[game].progress] + "
" + ntitle + "" + vgscol[game].system + "" + own_map[vgscol[game].ownership] + "" + prog_map[vgscol[game].progress] + "" + ts_to_isodate(vgscol[game].p_date) + "" + ts_to_isodate(vgscol[game].b_date) + "" + ts_to_isodate(vgscol[game].c_date) + "
\n"; -- cgit v1.2.3-70-g09d2