Format scheduled task intervals
Publish Docker Image / build-and-push (./build/Dockerfile, git.lzstealth.com/lzstealth/pulse-signage-web, web) (push) Successful in 1m25s
Publish Docker Image / build-and-push (./build/Dockerfile.player, git.lzstealth.com/lzstealth/pulse-signage-player, player) (push) Successful in 32s

This commit is contained in:
2026-08-14 00:20:48 +01:00
parent d6a8b45357
commit 30f5ed11b8
6 changed files with 57 additions and 3 deletions
+6
View File
@@ -2,6 +2,12 @@
All notable changes to this project will be documented in this file.
## 2.6.27 - 2026-08-14
### Fixed
- Scheduled task intervals now display the most appropriate exact unit, such as seconds, minutes, hours, or days, while keeping the sort order numeric.
## 2.6.26 - 2026-08-10
### Changed
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "pulse-signage-player",
"version": "2.6.26",
"version": "2.6.27",
"private": false,
"description": "Pulse Signage player application bundle",
"main": "src/common.js",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "pulse-signage-web",
"version": "2.6.26",
"version": "2.6.27",
"private": false,
"description": "Pulse Signage web and bridge application bundle",
"main": "src/common.js",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "pulse-signage",
"version": "2.6.26",
"version": "2.6.27",
"private": false,
"description": "Pulse Signage application with MySQL and media storage",
"repository": {
@@ -17,6 +17,14 @@ const DATE_FILTER_FIELDS = {
function formatIntervalLabel(intervalMs) {
const value = Math.max(1, Number(intervalMs) || 0);
if (value % 86400000 === 0) {
const days = Math.max(1, value / 86400000);
return days === 1 ? 'Every day' : `Every ${days} days`;
}
if (value % 3600000 === 0) {
const hours = Math.max(1, value / 3600000);
return hours === 1 ? 'Every hour' : `Every ${hours} hours`;
}
if (value % 60000 === 0) {
const minutes = Math.max(1, value / 60000);
return minutes === 1 ? 'Every minute' : `Every ${minutes} minutes`;
+40
View File
@@ -91,4 +91,44 @@ test('background task pages opt into 24-hour timestamps, confirm clearing tasks,
assert.match(queueDateSearchHtml, /Example task/);
assert.match(scheduledHtml, /data-local-datetime-format="24h"/);
assert.match(scheduledHtml, /Player:\s+Player Beta/);
});
test('scheduled task interval labels use the largest exact unit while sorting stays numeric', () => {
const scheduledHtml = renderBackgroundTasksScheduledPage(
{
recurringTasks: [
{
title: 'Hourly task',
key: 'hourly',
intervalMs: 7200000,
metadata: {}
},
{
title: 'Second task',
key: 'seconds',
intervalMs: 3000,
metadata: {}
},
{
title: 'Minute task',
key: 'minutes',
intervalMs: 60000,
metadata: {}
}
],
sort: 'interval',
direction: 'asc',
summary: { counts: {}, total: 3, activeCount: 0, scheduledCount: 3 }
},
'',
{
permissions: ['scheduled-tasks.allow']
}
);
assert.match(scheduledHtml, /Every 3 seconds/);
assert.match(scheduledHtml, /Every minute/);
assert.match(scheduledHtml, /Every 2 hours/);
assert.ok(scheduledHtml.indexOf('Every 3 seconds') < scheduledHtml.indexOf('Every minute'));
assert.ok(scheduledHtml.indexOf('Every minute') < scheduledHtml.indexOf('Every 2 hours'));
});