aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzlg <zlg@zlg.space>2025-08-02 23:33:12 -0700
committerzlg <zlg@zlg.space>2025-08-02 23:33:12 -0700
commit8f8ca7cc0ed420f3ee1fe0e672df4cc8a042ecf9 (patch)
tree954a4f548910ce3d9606246fefac41b200b7d1db /src
parentsetup.py: Add VGStash-Web to 'web' data directory (diff)
downloadvgstash-8f8ca7cc0ed420f3ee1fe0e672df4cc8a042ecf9.tar.gz
vgstash-8f8ca7cc0ed420f3ee1fe0e672df4cc8a042ecf9.tar.bz2
vgstash-8f8ca7cc0ed420f3ee1fe0e672df4cc8a042ecf9.tar.xz
vgstash-8f8ca7cc0ed420f3ee1fe0e672df4cc8a042ecf9.zip
vgstash-web: Include dates on default view displaysnext
All views now feature some way to represent the Purchase, Beaten, and Completion dates for games.
Diffstat (limited to 'src')
-rw-r--r--src/vgstash/web/vgstash.js11
1 files 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 = "<table>\n<colgroup>\n<col id=\"title_col\"></col>\n<col></col>\n<col></col>\n<col></col>\n<col></col>\n<col></col>\n</colgroup><thead>\n<th>Title</th>\n<th>System</th>\n<th>Ownership</th>\n<th>Progress</th>\n<th>Years</th>\n<th>Days</th>\n</thead>\n<tbody>\n";
} else {
- output = "<table>\n<colgroup>\n<col id=\"title_col\"></col>\n<col></col>\n<col></col>\n<col></col>\n</colgroup><thead>\n<th>Title</th>\n<th>System</th>\n<th>Ownership</th>\n<th>Progress</th>\n</thead>\n<tbody>\n";
+ output = "<table>\n<colgroup>\n<col id=\"title_col\"></col>\n<col></col>\n<col></col>\n<col></col>\n<col></col>\n<col></col>\n<col></col>\n</colgroup><thead>\n<th>Title</th>\n<th>System</th>\n<th>Ownership</th>\n<th>Progress</th>\n<th>Purchase Date</th>\n<th>Beaten Date</th>\n<th>Completion Date</th>\n</thead>\n<tbody>\n";
}
for (var game in vgscol) {
var has_notes = false;
@@ -191,7 +198,7 @@ function render(target, vgscol) {
if (current_filter == "backlog_age") {
output += "<tr><td>" + ntitle + "</td><td>" + vgscol[game].system + "</td><td>" + own_map[vgscol[game].ownership] + "</td><td>" + prog_map[vgscol[game].progress] + "</td><td>" + vgscol[game].years.toString() + "</td><td>" + vgscol[game].days.toString() + "</td></tr>\n";
} else {
- output += "<tr><td>" + ntitle + "</td><td>" + vgscol[game].system + "</td><td>" + own_map[vgscol[game].ownership] + "</td><td>" + prog_map[vgscol[game].progress] + "</td></tr>\n";
+ output += "<tr><td>" + ntitle + "</td><td>" + vgscol[game].system + "</td><td>" + own_map[vgscol[game].ownership] + "</td><td>" + prog_map[vgscol[game].progress] + "</td><td>" + ts_to_isodate(vgscol[game].p_date) + "</td><td>" + ts_to_isodate(vgscol[game].b_date) + "</td><td>" + ts_to_isodate(vgscol[game].c_date) + "</td></tr>\n";
}
}
output += "\n</tbody>\n</table>\n";
Remove ID field from DBzlg3-38/+46 2018-10-06cli: change "Status" heading to "Progress"zlg2-36/+40 2018-09-29Bump to 0.3alpha5 for PyPIzlg1-1/+1 2018-09-29cli: Add pretty printing to 'list' commandzlg3-17/+107 2018-09-08setup.py: Bump to alpha4 for PyPIzlg1-1/+1 2018-09-08cli: add '--raw' option to list commandzlg2-9/+45 2018-09-08Add remaining filters to vgstash packagezlg1-2/+11 2018-09-04Update LICENSE to match setup.pyzlg1-80/+67 2018-09-03Branch off from master with pytest, tox, clickzlg16-778/+779 2018-03-18Flesh out filter types and ownership statuszlg3-82/+144 2018-03-18README.mdown: break line correctlyzlg1-1/+1 2018-03-18add 'playlog' list filterzlg2-2/+9 2018-03-13Update helpers a bitzlg1-2/+9 2018-03-13Make VGSTASH_DB_LOCATION point to a filezlg2-21/+20 2016-11-18Remove settings from helpers.shZe Libertine Gamer1-5/+0 2016-11-15Correct phrasing in README.Ze Libertine Gamer1-4/+4 2016-11-13DerpZe Libertine Gamer1-0/+1 2016-11-03Improve error handling in shell scriptsZe Libertine Gamer4-3/+23 2016-10-24Correct run_again, add recursionZe Libertine Gamer1-0/+4 2016-10-21Add quotes to correct behavior for arglistZe Libertine Gamer1-1/+1 2016-10-14updater.sh: add recursion, error handlingZe Libertine Gamer1-43/+101 2016-10-14Correct pipe-handling behaviorZe Libertine Gamer1-1/+9 2016-10-12Clarify a method to move between platformsZe Libertine Gamer1-2/+5