mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-16 21:05:30 +03:00
Improve file name for backups
- Use ISO date formatting for better sortability - Added .json as file extension
This commit is contained in:
parent
e5568a9439
commit
9e59de1ab5
1 changed files with 2 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue