Bug 513782

Summary: Filename template datetime has no padding
Product: [Applications] Skanpage Reporter: kdebugtracking.attain157
Component: generalAssignee: Alexander Stippich <a.stippich>
Status: RESOLVED FIXED    
Severity: minor    
Priority: NOR    
Version First Reported In: 25.12.0   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 26.04.0
Sentry Crash Report:
Attachments: Example of bug (fail state)

Description kdebugtracking.attain157 2025-12-24 14:42:28 UTC
Created attachment 187941 [details]
Example of bug (fail state)

SUMMARY
Filename template datetime has no padding.  I've confirmed this for minutes and seconds.  So the time "15:36:04" the seconds would store as 4 instead of 04.  I have not checked hours, or the date component.  I've confirmed that this is indeed how it saves the files as well and it isn't limited just to the filename preview in settings.

STEPS TO REPRODUCE
1. Go to the settings screen
2. Use the datetime strings in the template, ie $[YYYY]-$[MM]-$[DD] $[hh]$[mm]$[ss]
3. Observe the example shown

OBSERVED RESULT
Missing padding on, at least, minutes and seconds, and probably more.

EXPECTED RESULT
That each value is 0-padded, so that the fields (and thus filenames) are always the same length

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 43
KDE Plasma Version: 6.5.4
KDE Frameworks Version: 6.21.0
Qt Version: 6.10.1
Kernel Version: 6.17.12-300.fc43.x86_64 (64-bit)
Graphics Platform: Wayland
Comment 1 Bug Janitor Service 2025-12-31 14:07:36 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/skanpage/-/merge_requests/115
Comment 2 Nate Graham 2025-12-31 15:40:48 UTC
Git commit 3b48c2f43030ffaaa0ab211f9cb28dd752a534fc by Nate Graham, on behalf of Nicola Felice.
Committed on 31/12/2025 at 15:40.
Pushed by ngraham into branch 'master'.

Add padding to file name templates

For date/time elements shorter than 2 digits, add a zero to the left to
keep the same length for all generated file names. Example:

    2025-12-9  -> 2025-12-09
    2025-12-10 -> 2025-12-10
FIXED-IN: 26.04.0

M  +6    -6    src/NameTemplateUtils.cpp

https://invent.kde.org/utilities/skanpage/-/commit/3b48c2f43030ffaaa0ab211f9cb28dd752a534fc