Skip to content

Commit

Permalink
Better date display
Browse files Browse the repository at this point in the history
  • Loading branch information
newca12 committed Jan 2, 2023
1 parent 12f4d5c commit 67ba045
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ iced = "0.6.0"
image = { version = "0.24.5", features = ["ico"], default-features = false }
instant = { version = "0.1.12", features = [ "wasm-bindgen", "inaccurate" ] }
num-traits = "0.2.15"
once_cell = "1.16.0"
once_cell = "1.17.0"
rand = "0.8.5"
Binary file modified screenshot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 13 additions & 1 deletion src/gui/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,19 @@ impl Application for ShakuntalaDeviTrainer {

let result = column![text(&self.hint).size(24)].padding(8);

let random_date = column![text(&self.random_date).size(48)].padding(8);
let random_date = {
let month = Month::from_u32(self.random_date.month()).unwrap().name();
let date = format!(
"{} {} {}",
self.random_date.day(),
month,
self.random_date.year()
);
match self.screen {
Screen::Game => column![text(date).size(48)].padding(8),
Screen::TrainingStep1 => column![text(month).size(48)].padding(8),
}
};

let first_year = column![text(self.first_year.to_string()).size(12)];

Expand Down

0 comments on commit 67ba045

Please sign in to comment.