Pebble App Framework: Phone API
    Preparing search index...

    Function keepStamps

    • The stamps worth keeping for a plan, oldest first.

      One older than the plan's longest window is let go. One in the future, after the phone's clock stepped back, counts as sent now rather than being dropped, so the count can never shrink because the clock moved, and it still ages out on time. One whose time is not a number is dropped.

      The calls of a UTC hour that ended a day ago or more are merged into one stamp at the hour's last moment, carrying their summed weight rounded up to thousandths. Only a month window can still see them by then. A clock month reads the same hour, and a rolling month holds them up to an hour longer, which errs on the side of fewer calls. A month of calls then keeps a stamp an hour for the month, plus one a call for the last day.

      Parameters

      • stamps: readonly Stamp[]

        The stamps.

      • plan: QuotaPlan

        The provider's plan.

      • nowMs: number

        Now, in epoch milliseconds.

      Returns Stamp[]

      The stamps the plan's windows can still see.