1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-17 13:25:24 +03:00

Improve file name for backups

- Use ISO date formatting for better sortability
- Added .json as file extension
This commit is contained in:
Sebastian Hammerl 2017-02-15 22:07:07 +01:00
parent e5568a9439
commit 9e59de1ab5

View file

@ -168,11 +168,10 @@ function configuration_backup(callback) {
}]; }];
// generate timestamp for the backup file // generate timestamp for the backup file
var d = new Date(), var now = new Date().toISOString().split(".")[0];
now = (d.getMonth() + 1) + '.' + d.getDate() + '.' + d.getFullYear() + '.' + d.getHours() + '.' + d.getMinutes();
// create or load the file // 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) { if (chrome.runtime.lastError) {
console.error(chrome.runtime.lastError.message); console.error(chrome.runtime.lastError.message);
return; return;