Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions cosmic-applet-time/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,16 +478,18 @@ impl cosmic::Application for Window {
let mut elements = Vec::new();

if self.config.show_date_in_top_panel {
let mut date_bag = Bag::empty();

date_bag.day = Some(components::Day::NumericDayOfMonth);
date_bag.month = Some(components::Month::Short);

let formated = self.format(date_bag, &self.now);

for p in formated.split_whitespace() {
elements.push(self.core.applet.text(p.to_owned()).into());
}
elements.push(
self.core
.applet
.text(format!("{:02}", self.now.month()))
.into(),
);
elements.push(
self.core
.applet
.text(format!("{:02}", self.now.day()))
.into(),
);

elements.push(
horizontal_rule(2)
Expand All @@ -500,6 +502,10 @@ impl cosmic::Application for Window {

time_bag.hour = Some(components::Numeric::Numeric);
time_bag.minute = Some(components::Numeric::Numeric);
time_bag.second = self
.config
.show_seconds
.then_some(components::Numeric::Numeric);

let hour_cycle = if self.config.military_time {
preferences::HourCycle::H23
Expand Down