diff options
-rw-r--r-- | src/locale.rs | 4 | ||||
-rw-r--r-- | src/main.rs | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/locale.rs b/src/locale.rs index 6b3b619..1bd190b 100644 --- a/src/locale.rs +++ b/src/locale.rs @@ -33,6 +33,10 @@ impl Locale { } } +pub fn get() -> &'static Locale { + &EN +} + pub const EN: Locale = Locale { weekdays: ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"], months: ["january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december"], diff --git a/src/main.rs b/src/main.rs index 8804dc7..a76b378 100644 --- a/src/main.rs +++ b/src/main.rs @@ -60,7 +60,8 @@ fn main() { None => chrono::Local::today().naive_utc(), }; - println!("{}", capitalize(&locale::NB.format_date(&local_date))); + let locale = locale::get(); + println!("{}", capitalize(&locale.format_date(&local_date))); let key = local_date.format("%d%m").to_string(); match data.get(serde_yaml::Value::Number(u32::from_str(&key).unwrap().into())) { |