Loop the day and night outside every hour - #194
Merged
Merged
Conversation
The sky used to follow the office machine's real clock, so a day took a day. Now the office's clock is sped up 24× for the sky (skyTime in shared/sun.ts): midnight on the hour, sunrise around a quarter past, noon at half past, sunset around a quarter to. It stays on today's date, so a --city office still gets that place's season's day length. Every browser keeps time by the office's clock, so everyone sees the same sky, and ⚙️ shows the sky's time of day. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The sky outside used to follow the office machine's real clock, so a full day took a day. Now a whole day and night go by every hour.
How
skyTime()insrc/shared/sun.tsspeeds the office's clock up 24× for the sky. Midnight falls on the hour and noon at half past, with sunrise around a quarter past and sunset around a quarter to. The date stays today's, so a--cityoffice still gets that place's day length for the season.Skykeeps time by the office's clock (store.officeNow()), not each browser's own, so everyone sees the same sky.🌙 Clear · 11:36 PM outside), and its note says a day goes by every hour.--help,docs/features.md,docs/how-it-works.mdanddocs/azure.mdare updated. A city still sets the weather, the season's day length and the holiday calendar, but no longer the time of day.Verified
npm run typecheck,npm test(414 + 3 new intests/sun.test.ts) andnpm run buildall pass.sky.daylight/lampsOn. It's dark until :16, the sun comes up at :17, it's full day from :18 to :46, the sun sets at :47, and it's night again by :49 through the next hour. Screenshots from the street at :00 (night), :18 (dawn), :30 (noon) and :50 (night) look right.🤖 Generated with Claude Code