sun_daylight
How long each sun is up on a date, and between which times of day. THE CURVE IS DECLARED BY THE SPEC, NEVER INFERRED, and that is the point of this tool: a shortest day, a longest day and a solstice do not say what happens between them — a sinusoid and a straight line honour all three and disagree everywhere else, by nearly a whole bell at the quarter points — so the spec names the shape ('sinusoid', 'linear', or 'table' given point by point) and this evaluates it exactly. It is NOT astronomy: no latitude, no axial tilt, no orbit, and no attempt at plausibility. It is exactly what the calendar describes, the same promise moon_phases makes. 'rise' and 'set' sit either side of each sun's own noon, so several suns can be up at different hours; both are null when a sun is up all day or not at all, which 'always_up' and 'never_up' say. 'wraps' means a sun's span runs through the turn of the day. 'lit' is the UNION of every sun's span, not the sum: two suns sharing the sky make one lit stretch, and adding them would claim a day longer than it is. Each lit stretch is half-open, so its 'to' is the tick the light stops at and is never wrapped round: a sun up the whole day closes at one whole day, not at nought. A sun that does not keep to the year declares a 'period' in whole days and a dated 'epoch' instead of a solstice; its noon then drifts through the day once per cycle — on its own 'noon_period' where the spec gives one — and 'cycle' says where in its DAYLIGHT cycle the date falls (null for a sun that keeps to the year). Any number of suns. Fails rather than guessing if the calendar declares no suns, or no 'day' block to measure them in. Pass 'dates' for more than one. Answers up to 1000 in one call, in the order given, as {count, ok, results}. Prefer this over one call per item: the spec travels once instead of once each.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | ||
| dates | No | ||
| calendar | Yes | ||
| on_error | No | fail |