Calendar Calculations Class for Windows

User projects written in or related to FreeBASIC.
rpkelly
Posts: 51
Joined: Sep 03, 2016 22:36

Calendar Calculations Class for Windows

Postby rpkelly » Dec 05, 2017 5:23

Calendar date and time calculations on GitHub at:

[url]
https://github.com/breacsealgaire/Calen ... -Freebasic
[/url]

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
paul doe
Posts: 707
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: Calendar Calculations Class for Windows

Postby paul doe » Dec 06, 2017 10:50

This is super useful stuff, as well as being an amazing work. Thanks for sharing!
rpkelly
Posts: 51
Joined: Sep 03, 2016 22:36

Re: Calendar Calculations Class for Windows

Postby rpkelly » Dec 08, 2017 3:04

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.
rpkelly
Posts: 51
Joined: Sep 03, 2016 22:36

Re: Calendar Calculations Class for Windows

Postby rpkelly » Dec 08, 2017 3:10

paul doe wrote:This is super useful stuff, as well as being an amazing work. Thanks for sharing!


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.
rpkelly
Posts: 51
Joined: Sep 03, 2016 22:36

Re: Calendar Calculations Class for Windows

Postby rpkelly » Jun 27, 2018 2:53

Library updated to version 1.10

https://github.com/breacsealgaire/Calendar_Calculations-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
dodicat
Posts: 5088
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Calendar Calculations Class for Windows

Postby dodicat » Jun 27, 2018 10:26

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.
rpkelly
Posts: 51
Joined: Sep 03, 2016 22:36

Re: Calendar Calculations Class for Windows

Postby rpkelly » Jun 27, 2018 22:22

Thank you, and, I removed the cCalendar folder for the library in the test scripts.
rpkelly
Posts: 51
Joined: Sep 03, 2016 22:36

Re: Calendar Calculations Class for Windows

Postby rpkelly » Jun 29, 2018 1:18

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?
andykmv
Posts: 30
Joined: Feb 12, 2015 9:50

Re: Calendar Calculations Class for Windows

Postby andykmv » Aug 04, 2018 22:23

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)

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 3 guests