Stundenliste fürs Steuerbüro als CSV (0.10.0)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AmyPfuNc4sCRfaF3oURXZz
This commit is contained in:
24
demo/main.ts
24
demo/main.ts
@@ -110,19 +110,19 @@ async function main() {
|
||||
return antwort;
|
||||
};
|
||||
|
||||
const datei = async (filename: string, data: string) => {
|
||||
if (!laden) throw new Error("Speichern als Datei geht in dieser Ansicht nicht.");
|
||||
try {
|
||||
await laden.save({ filename, data });
|
||||
return "Datei gesichert.";
|
||||
} catch (e) {
|
||||
if ((e as { code?: string }).code === "declined") return "Abgebrochen.";
|
||||
throw e;
|
||||
}
|
||||
};
|
||||
(globalThis as { betriebTestversion?: unknown }).betriebTestversion = {
|
||||
async sichern() {
|
||||
if (!laden) throw new Error("Speichern als Datei geht in dieser Ansicht nicht.");
|
||||
const datei = JSON.stringify(await exportiere(), null, 1);
|
||||
const tag = new Date().toISOString().slice(0, 10);
|
||||
try {
|
||||
await laden.save({ filename: `betrieb-${tag}.json`, data: datei });
|
||||
return "Datei gesichert.";
|
||||
} catch (e) {
|
||||
if ((e as { code?: string }).code === "declined") return "Abgebrochen.";
|
||||
throw e;
|
||||
}
|
||||
},
|
||||
sichern: async () => datei(`betrieb-${new Date().toISOString().slice(0, 10)}.json`, JSON.stringify(await exportiere(), null, 1)),
|
||||
datei,
|
||||
};
|
||||
|
||||
melde(speicher ? "Gespeichert" : "Nur ansehen: Änderungen werden hier nicht gespeichert.", speicher ? "ok" : "fehler");
|
||||
|
||||
Reference in New Issue
Block a user