The Problem
The current %date% template tag in the Conversion settings generates a full ISO datetime string (e.g., 2026-03-20T09:43:00.000Z).
For users managing daily recurring file the inclusion of timestamps and timezone data results in cluttered filenames that must be manually edited after every download. This limits the effectiveness of the automation provided by the template system.
Proposed Solution (Primary)
Refine the template tags to provide more granular control. This follows standard naming conventions where "date" refers strictly to the calendar day:
%datetime%: A new tag that provides the full timestamp (inheriting the current behavior of %date%).
%date%: Repurposed to provide only the date portion (e.g., YYYY-MM-DD).
Alternative Solution (Non-breaking)
If avoiding changes to existing user configurations is a priority, keep the current %date% behavior as-is and introduce a new specific tag:
%shortdate% or %d%: A new tag providing only the date portion (e.g., YYYY-MM-DD).
Technical Implementation Details
1. Logic Update
In src/lib/types/file.svelte.ts, the download() method currently handles these replacements. The formatting logic can be updated to support both variations:
// Proposed update to formatting logic in src/lib/types/file.svelte.ts
const format = (name: string) => {
const now = new Date();
const fullIso = now.toISOString();
const dateOnly = fullIso.split('T')[0]; // Result: YYYY-MM-DD
const baseName = this.file.name.replace(/\.[^/.]+$/, "");
const originalExtension = this.file.name.split(".").pop()!;
return name
.replace(/%datetime%/g, fullIso)
.replace(/%date%/g, dateOnly) // Or %shortdate% for the alternative
.replace(/%name%/g, baseName)
.replace(/%extension%/g, originalExtension);
};
2. Documentation & Typo Fix
The description for the filename format contains a minor grammatical error.
- File:
messages/en.json
- Key:
settings.conversion.filename_description
- Current: "...You can put these following templates..."
- Correction: "...You can put the following templates..."
The description should also be updated to list the new tag (either %datetime% or %shortdate%) so users are aware of the option.
Benefits
- Automation: Allows users to set a format once for daily files without manual intervention.
- Clarity: Aligns tag names with the actual data they produce, making the settings more intuitive.
The Problem
The current
%date%template tag in the Conversion settings generates a full ISO datetime string (e.g.,2026-03-20T09:43:00.000Z).For users managing daily recurring file the inclusion of timestamps and timezone data results in cluttered filenames that must be manually edited after every download. This limits the effectiveness of the automation provided by the template system.
Proposed Solution (Primary)
Refine the template tags to provide more granular control. This follows standard naming conventions where "date" refers strictly to the calendar day:
%datetime%: A new tag that provides the full timestamp (inheriting the current behavior of%date%).%date%: Repurposed to provide only the date portion (e.g.,YYYY-MM-DD).Alternative Solution (Non-breaking)
If avoiding changes to existing user configurations is a priority, keep the current
%date%behavior as-is and introduce a new specific tag:%shortdate%or%d%: A new tag providing only the date portion (e.g.,YYYY-MM-DD).Technical Implementation Details
1. Logic Update
In
src/lib/types/file.svelte.ts, thedownload()method currently handles these replacements. The formatting logic can be updated to support both variations:2. Documentation & Typo Fix
The description for the filename format contains a minor grammatical error.
messages/en.jsonsettings.conversion.filename_descriptionThe description should also be updated to list the new tag (either
%datetime%or%shortdate%) so users are aware of the option.Benefits