[feat](trx-frontend-http): treat 00:00–00:00 time span as all-day entry
start == end previously matched nothing (empty range). Now treated as a 24-hour window, making it easy to define a catch-all bookmark without manually entering 00:00–23:59. UI shows "All day / —" in the entries table and tooltip hints on both time inputs explain the convention. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
@@ -730,10 +730,10 @@
|
||||
</table>
|
||||
<div class="sch-row sch-add-row">
|
||||
<label class="sch-label">Start (UTC)
|
||||
<input type="time" id="scheduler-ts-start" class="status-input" />
|
||||
<input type="time" id="scheduler-ts-start" class="status-input" title="Set both to 00:00 for all-day" />
|
||||
</label>
|
||||
<label class="sch-label">End (UTC)
|
||||
<input type="time" id="scheduler-ts-end" class="status-input" />
|
||||
<input type="time" id="scheduler-ts-end" class="status-input" title="Set both to 00:00 for all-day" />
|
||||
</label>
|
||||
<label class="sch-label">Bookmark
|
||||
<select id="scheduler-ts-bookmark" class="status-input" aria-label="Entry bookmark"></select>
|
||||
|
||||
@@ -278,9 +278,10 @@
|
||||
entries.forEach(function (entry, idx) {
|
||||
const tr = document.createElement("tr");
|
||||
const il = entry.interleave_min ? String(entry.interleave_min) + " min" : "—";
|
||||
const allDay = entry.start_min === entry.end_min;
|
||||
tr.innerHTML =
|
||||
'<td>' + minToHHMM(entry.start_min) + '</td>' +
|
||||
'<td>' + minToHHMM(entry.end_min) + '</td>' +
|
||||
'<td>' + (allDay ? "All day" : minToHHMM(entry.start_min)) + '</td>' +
|
||||
'<td>' + (allDay ? "—" : minToHHMM(entry.end_min)) + '</td>' +
|
||||
'<td>' + bmName(entry.bookmark_id) + '</td>' +
|
||||
'<td>' + escHtml(entry.label || "") + '</td>' +
|
||||
'<td>' + il + '</td>' +
|
||||
|
||||
@@ -278,7 +278,10 @@ fn grayline_bookmark_id(gl: &GraylineConfig, now_min: f64) -> Option<String> {
|
||||
fn entry_is_active(entry: &ScheduleEntry, now_min: f64) -> bool {
|
||||
let start = entry.start_min as f64;
|
||||
let end = entry.end_min as f64;
|
||||
if start <= end {
|
||||
if start == end {
|
||||
// Equal start and end means all-day (24 h window).
|
||||
true
|
||||
} else if start < end {
|
||||
now_min >= start && now_min < end
|
||||
} else {
|
||||
// Spans midnight.
|
||||
|
||||
Reference in New Issue
Block a user