Skip to content
New issue

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

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

Already on GitHub? # to your account

some dates fail to calculate, including today, for specific coordinates #14

Closed
Quicksilver151 opened this issue Apr 8, 2024 · 2 comments
Assignees

Comments

@Quicksilver151
Copy link

    let params:Parameters = Configuration::with(Method::MuslimWorldLeague, Madhab::Shafi);
    let coordinates = Coordinates::new(3.12, 101.69);
    let schedule = PrayerTimes::new(Utc.ymd(2024, 4, 9), coordinates, params);

this code just straight up panics

output:

thread 'main' panicked at /home/renderinguser/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chrono-0.4.26/src/date.rs:104:42:
invalid time
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

with backtrace full

thread 'main' panicked at /home/renderinguser/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chrono-0.4.26/src/date.rs:104:42:
invalid time
stack backtrace:
   0:     0x557b21f57556 - std::backtrace_rs::backtrace::libunwind::trace::h6e4a662bea54ccfc
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x557b21f57556 - std::backtrace_rs::backtrace::trace_unsynchronized::hb42b4eb2797d9c0e
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x557b21f57556 - std::sys_common::backtrace::_print_fmt::h2bc261f3223f4e4d
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x557b21f57556 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h9cca0343d66d16a8
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x557b21f75cd0 - core::fmt::rt::Argument::fmt::h8b666c45176be671
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/core/src/fmt/rt.rs:142:9
   5:     0x557b21f75cd0 - core::fmt::write::h4311bce0ee536615
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/core/src/fmt/mod.rs:1120:17
   6:     0x557b21f5570f - std::io::Write::write_fmt::h0685c51539d0a0cd
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/std/src/io/mod.rs:1846:15
   7:     0x557b21f57334 - std::sys_common::backtrace::_print::h25f19b1d64e81f86
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x557b21f57334 - std::sys_common::backtrace::print::h2fb8f70628a241ed
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x557b21f58897 - std::panicking::default_hook::{{closure}}::h05093fe2e3ef454d
  10:     0x557b21f585f9 - std::panicking::default_hook::h5ac38aa38e0086d2
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/std/src/panicking.rs:292:9
  11:     0x557b21f58d28 - std::panicking::rust_panic_with_hook::hed79743dc8b4b969
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/std/src/panicking.rs:781:13
  12:     0x557b21f58c02 - std::panicking::begin_panic_handler::{{closure}}::ha437b5d58f431abf
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/std/src/panicking.rs:659:13
  13:     0x557b21f57a56 - std::sys_common::backtrace::__rust_end_short_backtrace::hd98e82d5b39ec859
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/std/src/sys_common/backtrace.rs:171:18
  14:     0x557b21f58954 - rust_begin_unwind
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/std/src/panicking.rs:647:5
  15:     0x557b21f2de15 - core::panicking::panic_fmt::hc69c4d258fe11477
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/core/src/panicking.rs:72:14
  16:     0x557b21f2ddd3 - core::panicking::panic_display::hfb0288ef2c290f1b
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/core/src/panicking.rs:196:5
  17:     0x557b21f2ddd3 - core::panicking::panic_str::h15b2ba5329b38d44
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/core/src/panicking.rs:171:5
  18:     0x557b21f2ddd3 - core::option::expect_failed::h5c9b166b5a7a71f0
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/core/src/option.rs:1988:5
  19:     0x557b21f2fa6c - core::option::Option<T>::expect::hc608b31744b078ec
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/core/src/option.rs:894:21
  20:     0x557b21f2ffdc - chrono::date::Date<Tz>::and_hms::h24b0c50625ff126f
                               at /home/renderinguser/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chrono-0.4.26/src/date.rs:104:9
  21:     0x557b21f34a39 - salah::astronomy::solar::SolarTime::setting_hour::h1a2de24cadaf3b8f
                               at /home/renderinguser/.cargo/registry/src/index.crates.io-6f17d22bba15001f/salah-0.7.1/src/astronomy/solar.rs:204:28
  22:     0x557b21f34788 - salah::astronomy::solar::SolarTime::time_for_solar_angle::hcdef4e95cf95b5bb
                               at /home/renderinguser/.cargo/registry/src/index.crates.io-6f17d22bba15001f/salah-0.7.1/src/astronomy/solar.rs:176:9
  23:     0x557b21f36de5 - salah::schedule::PrayerTimes::calculate_fajr::h8dc4a3a2ab0a8cd4
                               at /home/renderinguser/.cargo/registry/src/index.crates.io-6f17d22bba15001f/salah-0.7.1/src/schedule.rs:173:24
  24:     0x557b21f377b0 - salah::schedule::PrayerTimes::calculate_qiyam::h7900a79782d1a103
                               at /home/renderinguser/.cargo/registry/src/index.crates.io-6f17d22bba15001f/salah-0.7.1/src/schedule.rs:285:13
  25:     0x557b21f36b8b - salah::schedule::PrayerTimes::new::hed3e7414821d94f4
                               at /home/renderinguser/.cargo/registry/src/index.crates.io-6f17d22bba15001f/salah-0.7.1/src/schedule.rs:74:13
  26:     0x557b21f2eaea - salatui::main::h6581ff087fcc7f11
                               at /media/renderinguser/PR Disk/Projects/codestuffz/Rust/SalaTUI/src/main.rs:83:20
  27:     0x557b21f2e8cb - core::ops::function::FnOnce::call_once::hcc1331db0ae9ba61
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/core/src/ops/function.rs:250:5
  28:     0x557b21f2e72e - std::sys_common::backtrace::__rust_begin_short_backtrace::h4cb549bcd8a79faa
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/std/src/sys_common/backtrace.rs:155:18
  29:     0x557b21f2e831 - std::rt::lang_start::{{closure}}::h7a04a4152ebb6bd8
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/std/src/rt.rs:166:18
  30:     0x557b21f53131 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h8c00837184d6f522
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/core/src/ops/function.rs:284:13
  31:     0x557b21f53131 - std::panicking::try::do_call::hfd8273c3b0a89311
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/std/src/panicking.rs:554:40
  32:     0x557b21f53131 - std::panicking::try::h389092b34a7cd1de
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/std/src/panicking.rs:518:19
  33:     0x557b21f53131 - std::panic::catch_unwind::hd784b6d233abd2d5
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/std/src/panic.rs:142:14
  34:     0x557b21f53131 - std::rt::lang_start_internal::{{closure}}::h8d693c96d9aec4f8
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/std/src/rt.rs:148:48
  35:     0x557b21f53131 - std::panicking::try::do_call::h62b442e92648318b
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/std/src/panicking.rs:554:40
  36:     0x557b21f53131 - std::panicking::try::h3dd33ffb0232e2bf
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/std/src/panicking.rs:518:19
  37:     0x557b21f53131 - std::panic::catch_unwind::h388a168fe640f06a
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/std/src/panic.rs:142:14
  38:     0x557b21f53131 - std::rt::lang_start_internal::hdaf8b62dc8f7de54
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/std/src/rt.rs:148:20
  39:     0x557b21f2e80a - std::rt::lang_start::hb62aefc4103d5078
                               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/std/src/rt.rs:165:17
  40:     0x557b21f2eb2e - main
  41:     0x7fbed2111083 - __libc_start_main
                               at /build/glibc-wuryBv/glibc-2.31/csu/../csu/libc-start.c:308:16
  42:     0x557b21f2e54e - _start
  43:                0x0 - <unknown>
@insha insha self-assigned this Apr 20, 2024
@insha
Copy link
Owner

insha commented Apr 21, 2024

Thank you for submitting this issue. I have a fix ready and I am writing tests around it to make sure the fix is working and there are no regressions caused by it.

@insha insha closed this as completed in 0b777c3 Apr 21, 2024
@Quicksilver151
Copy link
Author

i had no idea that you fixed it. ive been sitting on making the tui salah app for ages lol. imma work on that now

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

No branches or pull requests

2 participants