mirror of
https://github.com/unraid/api.git
synced 2025-12-31 13:39:52 -06:00
fix(api): append time to formatted date when a custom date format is selected
This commit is contained in:
@@ -721,7 +721,14 @@ export class NotificationsService {
|
||||
return timestamp;
|
||||
}
|
||||
this.logger.debug(`[formatTimestamp] ${settings.date} :: ${settings.time} :: ${date}`);
|
||||
return strftime(settings.date, date);
|
||||
|
||||
let formatted = strftime(settings.date, date);
|
||||
// %c represents System Time (i.e. the system's default date-time format).
|
||||
// This seems to include time, so we shouldn't append time if %c is the format setting.
|
||||
if (settings.date !== '%c') {
|
||||
formatted += " " + strftime(settings.time ?? "%I:%M %p", date);
|
||||
}
|
||||
return formatted;
|
||||
}
|
||||
|
||||
/**------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user