Skip to main content

expiring

Function expiring 

Source
pub fn expiring(
    ctx: &Context,
    req: ExpiringRequest,
) -> Result<Outcome<Vec<ExpiringItem>>, CoreError>
Expand description

The items expiring within ExpiringRequest::days of today, soonest first.

Already-expired items are included, and sort first because their days_until_expiry is negative. Items with no readable date sort last, and are only present at all with ExpiringRequest::include_unknown.

§Dates

A date is read as %Y-%m-%d, %d.%m.%Y, %d/%m/%Y, %m/%d/%Y, %Y.%m.%d or %d-%m-%Y, in that order — so 01/02/2025 is the 1st of February, not the 2nd of January. Anything else counts as no date at all.

“Today” is the local date of the machine this runs on.

§Errors

As load.