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

Panic when IslamicUmmAlQura month has 31 days #4914

Closed
anba opened this issue May 17, 2024 · 1 comment · Fixed by #4904
Closed

Panic when IslamicUmmAlQura month has 31 days #4914

anba opened this issue May 17, 2024 · 1 comment · Fixed by #4904
Assignees
Labels
C-calendar Component: Calendars T-bug Type: Bad behavior, security, privacy

Comments

@anba
Copy link

anba commented May 17, 2024

use icu::calendar::Calendar;
use icu::calendar::islamic::IslamicUmmAlQura;
use icu::calendar::types::{Era, MonthCode};

use std::str::FromStr;

fn main() {
  let cal = IslamicUmmAlQura::new_always_calculating();
  let era = Era::from_str("ah").unwrap();
  let year = -6823;
  let month_code = MonthCode::from_str("M01").unwrap();
  let dt = cal.date_from_codes(era, year, month_code, 1);
}

panics with

umm-al-qura months must not be more than 30 days
@sffc
Copy link
Member

sffc commented May 17, 2024

This is fixed by #4904

@sffc sffc self-assigned this May 17, 2024
@sffc sffc added C-calendar Component: Calendars T-bug Type: Bad behavior, security, privacy labels May 17, 2024
@sffc sffc added this to the 1.5 Blocking ⟨P1⟩ milestone May 17, 2024
sffc added a commit to sffc/omnicu that referenced this issue May 17, 2024
sffc added a commit to sffc/omnicu that referenced this issue May 22, 2024
sffc added a commit to sffc/omnicu that referenced this issue May 22, 2024
@sffc sffc closed this as completed in d938156 May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-calendar Component: Calendars T-bug Type: Bad behavior, security, privacy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants