Skip to content
Snippets Groups Projects
Unverified Commit 1a788c58 authored by Rich Howell's avatar Rich Howell Committed by GitHub
Browse files

Added date to export file name (#580)

parent 72006ef6
No related branches found
No related tags found
No related merge requests found
import React from 'react'; import React from 'react';
import { format } from 'date-fns';
import { send } from 'loot-core/src/platform/client/fetch'; import { send } from 'loot-core/src/platform/client/fetch';
import { Text, Button } from 'loot-design/src/components/common'; import { Text, Button } from 'loot-design/src/components/common';
...@@ -8,7 +10,11 @@ import { Setting } from './UI'; ...@@ -8,7 +10,11 @@ import { Setting } from './UI';
export default function ExportBudget({ prefs }) { export default function ExportBudget({ prefs }) {
async function onExport() { async function onExport() {
let data = await send('export-budget'); let data = await send('export-budget');
window.Actual.saveFile(data, `${prefs.id}.zip`, 'Export budget'); window.Actual.saveFile(
data,
`${format(new Date(), 'yyyy-MM-dd')}-${prefs.id}.zip`,
'Export budget'
);
} }
return ( return (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment