Calendar date and time calculations on GitHub at:
https://github.com/breacsealgaire/Cale ... Freebasic
cCalendar_Test_Script3.txt updated to remove lunar illumination function. This function returned inconsistent results using the algorithm from Jean Meeus's book Astronomical Algorithms, Chapter 48, page 345.
*** Update ***
Finally figured out the lunar illumination function. I had to 'normalize' the lunar phase to the range 0 - 180 degrees.
Version 1.01
1. Renamed cCalendar.inc to cCalendar.bi
2. FB include folder cCalendar added
3. Function LunarIllumination added
Calendar Calculations Class for Windows
Re: Calendar Calculations Class for Windows
This is super useful stuff, as well as being an amazing work. Thanks for sharing!
Re: Calendar Calculations Class for Windows
There were still parameters without an explicit BYVAL/BYREF and there were mixed operands not supported by version 1.05 (fixed in version 1.06) which have been addressed via CLNG.
Compiled with 32/64 FB versions 1.05 and 1.06.
I also noted I labeled the class as for WIndows. Since I only develop for Windows, I don't know if other platforms are compatible.
GitHub updated to version 1.02.
Compiled with 32/64 FB versions 1.05 and 1.06.
I also noted I labeled the class as for WIndows. Since I only develop for Windows, I don't know if other platforms are compatible.
GitHub updated to version 1.02.
Re: Calendar Calculations Class for Windows
You're welcome! I first wrote most of the class with MASM32 in 1997, ported it to Paradox ObjectPal, ported it to Powerbasic, and now this FB version which is the latest incarnation with all the latest calendar stuff I have accumulated over the years. I have another big push planned in 2018.paul doe wrote:This is super useful stuff, as well as being an amazing work. Thanks for sharing!
Re: Calendar Calculations Class for Windows
Library updated to version 1.10
https://github.com/breacsealgaire/Calen ... -Freebasic
Changes:
1. Added support for Samaritan calendar
2. Higher precisions for astronomical calculations
3. Separation of functions for moonrise and moonset
4. Additional support for Daylight Savings adjustments
5. Location support added to Function LunarIllumination
6. Support functions cmApparentFromUniversal and cmUniversalFromApparent added
https://github.com/breacsealgaire/Calen ... -Freebasic
Changes:
1. Added support for Samaritan calendar
2. Higher precisions for astronomical calculations
3. Separation of functions for moonrise and moonset
4. Additional support for Daylight Savings adjustments
5. Location support added to Function LunarIllumination
6. Support functions cmApparentFromUniversal and cmUniversalFromApparent added
Re: Calendar Calculations Class for Windows
Nice work.
An enormous task.
You have
#Include Once "cCalendar\cCalendar.bi"
But you have no cCalendar folder.
..
#Include Once "cCalendar.bi"
does fine here.
An enormous task.
You have
#Include Once "cCalendar\cCalendar.bi"
But you have no cCalendar folder.
..
#Include Once "cCalendar.bi"
does fine here.
Re: Calendar Calculations Class for Windows
Thank you, and, I removed the cCalendar folder for the library in the test scripts.
Re: Calendar Calculations Class for Windows
The next logical step with the cCalendar class is to add time zone support using the IANA source at https://www.iana.org/time-zones.
I'm thinking of having the parser I am working on emit DATA statements that can be pulled into a class via includes. Updates would be just downloading the latest IANA files and running the parser and updating the includes. The class would then load values into internal arrays that are used for all the function calls.
Any ideas on a better design?
I'm thinking of having the parser I am working on emit DATA statements that can be pulled into a class via includes. Updates would be just downloading the latest IANA files and running the parser and updating the includes. The class would then load values into internal arrays that are used for all the function calls.
Any ideas on a better design?
Re: Calendar Calculations Class for Windows
this looks interesting! and that's very nice work on the library.
i was looking at date time stuff this morning (as part of an ongoing project) and happened to be reading about ICU library http://site.icu-project.org/ which at a quick scan seemed to have some relevant stuff in it and draws on the iana library too. had you tried it ? (i was pondering using it for the timezone and date/time conversion utilities)
i was looking at date time stuff this morning (as part of an ongoing project) and happened to be reading about ICU library http://site.icu-project.org/ which at a quick scan seemed to have some relevant stuff in it and draws on the iana library too. had you tried it ? (i was pondering using it for the timezone and date/time conversion utilities)