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

    Function horizonFor

    • The last second of the window the agenda shows, the week unless told otherwise.

      The window runs to the end of its last day on the phone's clock, the last second before that day's midnight. The week is today and the next six days. With days it holds that many days, today counted, so { days: 1 } ends at today's last second. Six days on from now would cut the last day at whatever time the calendar was read, keeping a morning event on it and dropping an evening one. The day is counted on the calendar rather than in hours, so a clock change inside the window still ends it on midnight.

      Parameters

      • nowSeconds: number

        The moment to treat as now, as epoch seconds.

      • Optionaloptions: PhoneOffset | HorizonOptions

        How many days the window holds, and how its days are counted, or the offset reader alone. The offset reader is passed only by a spec that stands the phone in another zone. The days are then counted from the offset at each midnight, which ends the window an hour short in a zone whose clocks change at midnight, such as Chile's. Left out, the days are counted on the phone's own clock, which is what every reader does on a real phone.

      Returns number

      The window's last second, as epoch seconds.