Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set_timezone issue #28

Merged
merged 1 commit into from
Jan 5, 2023
Merged

Conversation

Ty3uK
Copy link
Contributor

@Ty3uK Ty3uK commented Jan 5, 2023

Fix error when offset starts with '+' or '-':

thread 'tokio-runtime-worker' panicked at 'called Result::unwrap() on an Err value: "Timezone information not found"', src/util/calculator.rs:26:32

note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

For example for Asia/Almaty (located in Kazakhstan) offset_from_utc_date returns "+6" rather than "GMT+6".

This leads to an error beacuse Regex in Smartcalc expects offset with GMT in string:

https://github.com/erhanbaris/smartcalc/blob/cd39b590aba74e8ca326ba78acea488d0550a3e8/src/json/config.json#L35

Fix error when offset starts with '+' or '-':

```
thread 'tokio-runtime-worker' panicked at 'called Result::unwrap() on an Err value: "Timezone information not found"', src/util/calculator.rs:26:32

note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
```

For example for `Asia/Almaty` (located in Kazakhstan) `offset_from_utc_date` returns "+6" rather than "GMT+6".

This leads to an error beacuse Regex in Smartcalc expects offset with `GMT` in string:

https://github.com/erhanbaris/smartcalc/blob/cd39b590aba74e8ca326ba78acea488d0550a3e8/src/json/config.json#L35
@ParthJadhav
Copy link
Owner

Ohh, Good Catch @Ty3uK , Thanks for the Contribution 🚀

I'll merge this and create a minor release.

@ParthJadhav ParthJadhav merged commit b816c6c into ParthJadhav:master Jan 5, 2023
@Ty3uK
Copy link
Contributor Author

Ty3uK commented Jan 5, 2023

Thanks for immediate response! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants