From df581338516220da499857b2c7af8d4d7fe5788a Mon Sep 17 00:00:00 2001 From: Namilskyy Date: Sat, 22 Nov 2025 22:23:38 +0300 Subject: Added timezone in config --- src/parser.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/parser.rs b/src/parser.rs index 8def9c2..06afce7 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -30,6 +30,7 @@ pub async fn parse_weather() -> Result> "hourly", "temperature_2m,relative_humidity_2m,wind_speed_10m".to_string(), ), + ("timezone", config.timezone.unwrap_or("Europe/London".to_string())), ]) .send() .await?; @@ -55,6 +56,7 @@ pub struct Config { lat: f64, lon: f64, exclude: String, + timezone: Option, } pub fn get_config() -> Result> { @@ -92,7 +94,7 @@ pub fn generate_cachedir() -> Result<(), Box> { /// exclude = "" pub fn generate_config() -> Result<(), Box> { let config_path = get_config_path()?; - let config = "lat = 55.75\nlon = 37.62\nexclude = \"\""; + let config = "lat = 55.75\nlon = 37.62\nexclude = \"\"\ntimezone = \"Europe/Moscow\""; let path = std::path::Path::new(&config_path); if let Some(parent) = path.parent() { fs::create_dir_all(parent)?; -- cgit v1.2.3