diff --git a/docs/modules/Clock.md b/docs/modules/Clock.md index a513987..13932c7 100644 --- a/docs/modules/Clock.md +++ b/docs/modules/Clock.md @@ -8,9 +8,12 @@ Clicking on the widget opens a popup with the time and a calendar. > Type: `clock` -| Name | Type | Default | Description | -|----------|----------|------------------|------------------------------------------------------------------------------------------------------------------------------------------| -| `format` | `string` | `%d/%m/%Y %H:%M` | Date/time format string. Detail on available tokens can be found here: | +| Name | Type | Default | Description | +|----------------|----------|------------------|---------------------------------------------------------| +| `format` | `string` | `%d/%m/%Y %H:%M` | Date/time format string. | +| `format_popup` | `string` | `%H:%M:%S` | Date/time format string to display in the popup header. | + +> Detail on available tokens can be found here:
JSON diff --git a/src/modules/clock.rs b/src/modules/clock.rs index 4102f92..e974466 100644 --- a/src/modules/clock.rs +++ b/src/modules/clock.rs @@ -23,6 +23,9 @@ pub struct ClockModule { #[serde(default = "default_format")] format: String, + #[serde(default = "default_popup_format")] + format_popup: String, + #[serde(flatten)] pub common: Option, } @@ -31,6 +34,10 @@ fn default_format() -> String { String::from("%d/%m/%Y %H:%M") } +fn default_popup_format() -> String { + String::from("%H:%M:%S") +} + impl Module