mirror of
https://github.com/atuinsh/atuin.git
synced 2024-12-01 12:46:10 +01:00
Deprecated usage 1 fixed
This commit is contained in:
parent
40d880a877
commit
64556d6dce
@ -29,7 +29,7 @@ pub fn data_dir() -> PathBuf {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_days_from_month(year: i32, month: u32) -> i64 {
|
pub fn get_days_from_month(year: i32, month: u32) -> i64 {
|
||||||
NaiveDate::from_ymd(
|
NaiveDate::from_ymd_opt(
|
||||||
match month {
|
match month {
|
||||||
12 => year + 1,
|
12 => year + 1,
|
||||||
_ => year,
|
_ => year,
|
||||||
@ -40,7 +40,8 @@ pub fn get_days_from_month(year: i32, month: u32) -> i64 {
|
|||||||
},
|
},
|
||||||
1,
|
1,
|
||||||
)
|
)
|
||||||
.signed_duration_since(NaiveDate::from_ymd(year, month, 1))
|
.expect("Invalid month")
|
||||||
|
.signed_duration_since(NaiveDate::from_ymd_opt(year, month, 1).expect("Invalid month"))
|
||||||
.num_days()
|
.num_days()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user