Fixed filename timestamp
All checks were successful
Build / Build NPM Project (push) Successful in 1m20s
Build / Tag Version (push) Successful in 15s
Build / Publish Documentation (push) Successful in 56s

This commit is contained in:
Zakary Timson 2025-06-23 18:08:25 -04:00
parent 91dc17667e
commit 8c1fb2d8cb
2 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@ztimson/utils", "name": "@ztimson/utils",
"version": "0.25.14", "version": "0.25.15",
"description": "Utility library", "description": "Utility library",
"author": "Zak Timson", "author": "Zak Timson",
"license": "MIT", "license": "MIT",

View File

@ -77,7 +77,7 @@ export function fileText(file: any): Promise<string | null> {
*/ */
export function timestampFilename(name?: string, date: Date | number | string = new Date()) { export function timestampFilename(name?: string, date: Date | number | string = new Date()) {
if(typeof date == 'number' || typeof date == 'string') date = new Date(date); if(typeof date == 'number' || typeof date == 'string') date = new Date(date);
const timestamp = formatDate('YYYY-MM-DD_HH:mm:ss', date); const timestamp = formatDate('YYYY-MM-DD_HH-mm', date);
return name ? name.replace('{{TIMESTAMP}}', timestamp) : timestamp; return name ? name.replace('{{TIMESTAMP}}', timestamp) : timestamp;
} }