cox -> show next year staring from december
This commit is contained in:
parent
0b46cbf8db
commit
0645103466
@ -885,12 +885,26 @@ ORDER BY last_access DESC
|
|||||||
//december
|
//december
|
||||||
//has 31
|
//has 31
|
||||||
//days
|
//days
|
||||||
end_of_year
|
let days_left_in_year = end_of_year
|
||||||
.signed_duration_since(Local::now().date_naive())
|
.signed_duration_since(Local::now().date_naive())
|
||||||
.num_days()
|
.num_days()
|
||||||
+ 1
|
+ 1;
|
||||||
|
|
||||||
|
if days_left_in_year < 30 {
|
||||||
|
let end_of_next_year =
|
||||||
|
NaiveDate::from_ymd_opt(Local::now().year() + 1, 12, 31).unwrap(); //Ok,
|
||||||
|
//december
|
||||||
|
//has 31
|
||||||
|
//days
|
||||||
|
end_of_next_year
|
||||||
|
.signed_duration_since(Local::now().date_naive())
|
||||||
|
.num_days()
|
||||||
|
+ 1
|
||||||
|
} else {
|
||||||
|
days_left_in_year
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
6
|
10
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user