Calendar event enumerator #110
Replies: 4 comments 3 replies
-
Wooow yess! |
Beta Was this translation helpful? Give feedback.
-
OK, great! I will add some more enumerators in the calendar2 branch over the next few days. Basically I will add anything I can think of that I would personally want to see on an astronomy calendar. |
Beta Was this translation helpful? Give feedback.
-
Tonight I added the following calendar enumerators:
The remaining ideas on my list to be completed are:
|
Beta Was this translation helpful? Give feedback.
-
I finished the calendar demo and it is now merged into the master branch. Its output is quite lengthy. For a real calendar, I suspect we would omit sunrise, sunset, moonrise, moonset, and Sun & Moon culmination events. If someone clicked on a particular calendar day, we could show all of those things, but for the overall calendar view, it would be a lot more efficient to only calculate events that don't happen every single day. |
Beta Was this translation helpful? Give feedback.
-
@matheo I have started a prototype of the calendar event enumerator as we discussed earlier. It is in the calendar2 branch. Take a look at calendar.ts.
The idea is that there are event enumerator classes you can create that follow a simple FindFirst/FindNext interface. Then you feed them into an
EventCollator
which merges the multiple event streams into one chronological stream. It does the minimum amount of work to iterate one event at a time, and uses only a small amount of memory. I think this would be a pretty good algorithm to feed a dynamic calendar inside a UI.The example output is in calendar_correct.txt, which is a flat listing of sunrise, sunset, moonrise, moonset, season changes (equinoxes and solstices), and moon phases. I will add many more enumerators of interesting events soon (eclipses, conjunctions, etc).
I'll be interested to know what you think. Is this something you could build a calendar UI from?
Beta Was this translation helpful? Give feedback.
All reactions