feat: Add support for 12-hour clock formatting on timelines (#1862)

- Closes #1779 


[skip ci]
This commit is contained in:
Dermot Duffy
2025-02-01 13:37:12 -08:00
committed by GitHub
parent 3e8e688b36
commit f123bb91dd
14 changed files with 156 additions and 3 deletions
+19
View File
@@ -112,6 +112,7 @@ media_viewer:
| ---------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `clustering_threshold` | `3` | The minimum number of overlapping events to allow prior to clustering/grouping them. Higher numbers cause clustering to happen less frequently. Depending on the timescale/zoom of the timeline, the underlying timeline library may still allow overlaps for low values of this parameter -- for a fully "flat" timeline use the `ribbon` style. `0` disables clustering entirely. Only used in the `stack` style of timeline. |
| `events_media_type` | `all` | Whether to show only events with `clips`, events with `snapshots` or `all` events. When `all` is used, `clips` are favored for events that have both a clip and a snapshot. |
| `format` | | Configuration for the timeline time & date format. See below. |
| `mode` | `none` | Whether to show the thumbnail carousel `below` the media, `above` the media, in a drawer to the `left` or `right` of the media or to hide it entirely (`none`). |
| `pan_mode` | `pan` | See [timeline pan mode](timeline-pan-mode.md). |
| `show_recordings` | `true` | Whether to show recordings on the timeline (specifically: which hours have any recorded content). |
@@ -120,6 +121,22 @@ media_viewer:
[](common/timeline-seek-info.md ':include')
#### `format`
Configure the date and time format for the `timeline` view.
```yaml
media_viewer:
controls:
timeline:
format:
# [...]
```
| Option | Default | Description |
| ------ | ------- | ------------------------------------------------------------------------------- |
| `24h` | `true` | If `true` shows time in 24-hour clock. If `false` otherwise uses 12-hour clock. |
## `display`
Controls whether to show a single media item or grid in the media viewer.
@@ -188,6 +205,8 @@ media_viewer:
events_media_type: all
show_recordings: true
window_seconds: 3600
format:
24h: true
display:
mode: single
grid_selected_width_factor: 2