Added date property to savefiles.

This commit is contained in:
chris062689 2017-06-07 00:52:57 -04:00
parent cf700917c4
commit 745d17d1fb

View File

@ -77,7 +77,6 @@ try {
model.testcase_date = "2000-01-01"; model.testcase_date = "2000-01-01";
} else { } else {
let recent = model.testcases[0]; let recent = model.testcases[0];
model.compatibility = recent.compatibility; model.compatibility = recent.compatibility;
model.testcase_date = recent.date; model.testcase_date = recent.date;
} }
@ -101,8 +100,11 @@ try {
// Read the data file into an object. // Read the data file into an object.
let savefile = toml.parse(fs.readFileSync(`${fsPathCodeSavefilesGame}/${file}`, 'utf8')); let savefile = toml.parse(fs.readFileSync(`${fsPathCodeSavefilesGame}/${file}`, 'utf8'));
let stats = fs.statSync(`${fsPathCodeSavefilesGame}/${file}`);
// Store the contents of the file in memory for adding it into the markdown later. // Store the contents of the file in memory for adding it into the markdown later.
model.savefiles.push({ model.savefiles.push({
date: new Date(util.inspect(stats.mtime)),
filename: file.replace('.dat', '.zip'), filename: file.replace('.dat', '.zip'),
title: savefile.title, title: savefile.title,
description: savefile.description, description: savefile.description,