Use minute precision for timetable date filters
This commit is contained in:
1 parent
05c9341b08
commit
0e77998e92
3 files changed
+9
-3
No files matched your search
@@ -9,6 +9,10 @@ All notable changes to this project will be documented in this file.
|
||||
- Added configurable audit events for media-library assets, managed fonts, and weather icon sets.
|
||||
- Added All / Between Dates / Before Date / After Date filtering to timetable regions, with optional inclusive start-time boundaries shared by previews and playback.
|
||||
|
||||
### Changed
|
||||
|
||||
- Timetable date-filter inputs retain the date, hours, and minutes but omit seconds.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Prevented deletion of media referenced from rich-text slide content.
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
return '';
|
||||
}
|
||||
function pad(part) { return String(part).padStart(2, '0'); }
|
||||
return date.getFullYear() + '-' + pad(date.getMonth() + 1) + '-' + pad(date.getDate()) + 'T' + pad(date.getHours()) + ':' + pad(date.getMinutes()) + ':' + pad(date.getSeconds());
|
||||
return date.getFullYear() + '-' + pad(date.getMonth() + 1) + '-' + pad(date.getDate()) + 'T' + pad(date.getHours()) + ':' + pad(date.getMinutes());
|
||||
}
|
||||
|
||||
function getDateRangeConfig(regionId, card, current) {
|
||||
@@ -362,7 +362,7 @@
|
||||
var label = boundary === 'from' ? 'Starts on or after (local time)' : 'Starts on or before (local time)';
|
||||
return '<div class="col-12 col-md-6" data-timetable-boundary' + (!enabled ? ' hidden' : '') + '>' +
|
||||
'<label class="form-label" for="region_' + field + '_' + region.id + '">' + label + '</label>' +
|
||||
'<input id="region_' + field + '_' + region.id + '" type="datetime-local" step="1" class="form-control" data-timetable-date="' + field + '" value="' + escapeHtml(toLocalInput(current[field])) + '"' + (!enabled ? ' disabled' : '') + ' />' +
|
||||
'<input id="region_' + field + '_' + region.id + '" type="datetime-local" step="60" class="form-control" data-timetable-date="' + field + '" value="' + escapeHtml(toLocalInput(current[field])) + '"' + (!enabled ? ' disabled' : '') + ' />' +
|
||||
'<input type="hidden" name="region_' + field + '_' + region.id + '" value="' + escapeHtml(current[field] || '') + '" />' +
|
||||
'</div>';
|
||||
}).join('') +
|
||||
|
||||
@@ -139,8 +139,10 @@ test('timetable date controls default to all and pass unsaved date ranges to pre
|
||||
assert.match(html, /<option value="all" selected>All<\/option>/);
|
||||
assert.match(html, /data-timetable-date-range hidden/);
|
||||
assert.match(html, /data-timetable-date="date_from"[^>]* disabled/);
|
||||
const saved = { date_filter: 'between', date_from: '2099-08-20T10:00:00.000Z', date_to: '' };
|
||||
const saved = { date_filter: 'between', date_from: '2099-08-20T10:00:45.000Z', date_to: '' };
|
||||
const enabled = module.renderEditorCard({ region, current: saved, timetableGroups: [] });
|
||||
assert.equal((enabled.match(/type="datetime-local" step="60"/g) || []).length, 2);
|
||||
assert.match(enabled, /data-timetable-date="date_from" value="\d{4}-\d{2}-\d{2}T\d{2}:\d{2}"/);
|
||||
assert.match(enabled, /<option value="between" selected>Between Dates<\/option>/);
|
||||
assert.doesNotMatch(enabled, /data-timetable-date-range hidden/);
|
||||
assert.doesNotMatch(enabled, /data-timetable-date="date_from"[^>]* disabled/);
|
||||
|
||||
Reference in new issue
Block a user