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
@@ -118,6 +118,7 @@ live:
| ---------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `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). |
@@ -126,6 +127,22 @@ live:
[](common/timeline-seek-info.md ':include')
#### `format`
Configure the date and time format for the `timeline` view.
```yaml
live:
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 or grid `live` view.
@@ -213,6 +230,8 @@ live:
events_media_type: all
show_recordings: true
window_seconds: 3600
format:
24h: true
microphone:
always_connected: false
disconnect_seconds: 90
+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
+17
View File
@@ -19,6 +19,7 @@ You can interact with the timeline in a number of ways:
| `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. |
| `controls` | | Configuration for the timeline controls. See below. |
| `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. |
| `show_recordings` | `true` | Whether to show recordings on the timeline (specifically: which hours have any recorded content). |
| `style` | `stack` | Whether the timeline should show events as a single flat `ribbon` or a `stack` of events that are clustered using the `clustering_threshold`. |
| `window_seconds` | `3600` | The length of the default timeline in seconds. By default, 1 hour (`3600` seconds) is shown in the timeline. |
@@ -37,6 +38,20 @@ timeline:
| ------------ | ------- | ---------------------------------------------------------------------- |
| `thumbnails` | | Configures how thumbnails are shown on the `timeline` view. See below. |
## `format`
Configure the date and time format for the `timeline` view.
```yaml
timeline:
format:
# [...]
```
| Option | Default | Description |
| ------ | ------- | ------------------------------------------------------------------------------- |
| `24h` | `true` | If `true` shows time in 24-hour clock. If `false` otherwise uses 12-hour clock. |
### `thumbnails`
Configures how thumbnails are shown on the timeline.
@@ -68,6 +83,8 @@ timeline:
events_media_type: all
show_recordings: true
window_seconds: 3600
format:
24h: true
controls:
thumbnails:
mode: left