This project is not covered by Drupal’s security advisory policy.
Circadian answers one question: is it day or night right now at a given place? It decides from the real sunrise and sunset there, from fixed clock times, or from a manual setting, and makes the answer available to themes and modules as a service and as tokens. Use it to switch a theme between day and night styles, show different content after dark, or vary behaviour by time of day.
Features
- Three modes: automatic (real sunrise and sunset at your location), scheduled (fixed times, which may run across midnight, e.g. 20:00 to 04:00), or manual.
- Service and tokens with proper cache metadata, so themes and modules can ask "is it night?" safely.
- Sunrise, sunset and weather block. Weather comes from Open-Meteo (worldwide) or the US National Weather Service, through WeatherProvider plugins. Other providers can be added.
- Sky block with the astronomical dark window, the Moon's phase (calculated locally) and, optionally, the next visible pass of the International Space Station.
- Shows the position rounded to one decimal, never the exact coordinates.
- Status report entries, uninstall clean-up and its own "Administer Circadian" permission.
Similar projects
Weather modules show forecasts. Dark mode modules follow a user toggle or the visitor's OS setting. Circadian is different: it works out day and night from the sun at a location and exposes that as an API.
Requirements
- Drupal 10.3 or 11.
- Outbound HTTPS to sunrise-sunset.org and your weather provider.
- Optional: for ISS passes, the Predict library (shupp/predict). It is not on Packagist, so it is listed under composer "suggest" and the README shows the repository entry to add. Without it, the ISS line is simply left out.
Installation
Install as you would any contributed module: composer require drupal/circadian, then enable it.
Configuration
- Grant the "Administer Circadian" permission as needed.
- Go to Configuration » System » Circadian. Set a latitude and longitude (there is no default) and choose a mode and a weather provider.
- Place the blocks you want, and use the service or tokens in your theme.
Data sources
Sunrise and sunset: sunrise-sunset.org. Weather: Open-Meteo (CC BY 4.0) or the US National Weather Service. ISS orbital data: CelesTrak, fetched at most twice a day. Please keep the attribution shown with the data.
Project information
- Project categories: Content display, Integrations
- Created by liampward on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
