Skip to Content
Octopus Energy Packages
Concepts

Time and availability

Why measurement views need data-aware dates

Measurement data is time-based, but the newest calendar date is not always the best date to show. Smart meter readings can arrive late, be incomplete, or have gaps. A good measurement UI needs to account for that before choosing its initial range.

Timeframe

A timeframe is the resolved range the user is viewing. It starts with familiar controls such as date, period, interval, and timezone, then resolves them into exact request bounds.

Fetching uses those bounds. When the user moves to the next week or previous month, the timeframe changes and the fetched data changes with it.

Availability

A valid date can still be a poor default. Today may not have readings yet, yesterday may be partial, or one utility may have data while another does not. This is why measurement experiences often need a data-aware starting point instead of always using today.

Anchor date

An anchor date is the package's term for a useful recent date to initialise a measurement view. It represents a calendar day in the configured IANA timezone, not a UTC timestamp. It is usually resolved before the chart renders, then passed as the default date for timeframe state.

Use the same timezone for anchor-date resolution and the resulting timeframe so availability lookups and measurement bounds use the same calendar. Resolving the anchor date on the server is usually the smoothest option because the first client render already has a complete timeframe default.

Where to go next

On this page