From 9e59de1ab5d08dd29d0b97d35f2ec0c5855b6945 Mon Sep 17 00:00:00 2001 From: Sebastian Hammerl Date: Wed, 15 Feb 2017 22:07:07 +0100 Subject: [PATCH] Improve file name for backups - Use ISO date formatting for better sortability - Added .json as file extension --- js/backup_restore.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/js/backup_restore.js b/js/backup_restore.js index 07fad3d5..1b6e56cf 100644 --- a/js/backup_restore.js +++ b/js/backup_restore.js @@ -168,11 +168,10 @@ function configuration_backup(callback) { }]; // generate timestamp for the backup file - var d = new Date(), - now = (d.getMonth() + 1) + '.' + d.getDate() + '.' + d.getFullYear() + '.' + d.getHours() + '.' + d.getMinutes(); + var now = new Date().toISOString().split(".")[0]; // create or load the file - chrome.fileSystem.chooseEntry({type: 'saveFile', suggestedName: 'betaflight_backup_' + now, accepts: accepts}, function (fileEntry) { + chrome.fileSystem.chooseEntry({type: 'saveFile', suggestedName: 'betaflight_backup_' + now + '.json', accepts: accepts}, function (fileEntry) { if (chrome.runtime.lastError) { console.error(chrome.runtime.lastError.message); return;