Skip to content

Commit 57de73b

Browse files
authored
Merge pull request #438 from sebastianha/master
Improve file name for backups
2 parents 92f59fc + 9e59de1 commit 57de73b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

js/backup_restore.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,10 @@ function configuration_backup(callback) {
168168
}];
169169

170170
// generate timestamp for the backup file
171-
var d = new Date(),
172-
now = (d.getMonth() + 1) + '.' + d.getDate() + '.' + d.getFullYear() + '.' + d.getHours() + '.' + d.getMinutes();
171+
var now = new Date().toISOString().split(".")[0];
173172

174173
// create or load the file
175-
chrome.fileSystem.chooseEntry({type: 'saveFile', suggestedName: 'betaflight_backup_' + now, accepts: accepts}, function (fileEntry) {
174+
chrome.fileSystem.chooseEntry({type: 'saveFile', suggestedName: 'betaflight_backup_' + now + '.json', accepts: accepts}, function (fileEntry) {
176175
if (chrome.runtime.lastError) {
177176
console.error(chrome.runtime.lastError.message);
178177
return;

0 commit comments

Comments
 (0)