javalent / calendarium

The ultimate Obsidian plugin for crafting mind-bending fantasy and sci-fi calendars
MIT License
77 stars 10 forks source link

[Bug]: Moons and leap days of imported Fantasy Calendar calendar not matching behavior on FC #42

Open Suleiman212 opened 1 year ago

Suleiman212 commented 1 year ago

Check for existing bug reports before submitting.

Expected Behavior

Moons should be cycling through the phases continuously across the years, lining up with new moons at the start of each month, and the leap days should be occurring on the intervals specified in the Fantasy Calendar, on years 2,5,7,10,13,16,19,21,24 of every 25 year cycle.

Current behaviour

Moons are discontinuous across for example the end of year 1 and beginning of year 2, jumping a full quarter cycle and misaligning all the months from the moon phases. Leap days occur on repeating, individual intervals of 2,5,7,10,13,16,19,21,24 offset by 25 years, far more frequently than should be the case.

Reproduction

  1. Launch Obsidian with b12 of Calanderium.
  2. Import the provided Json exported from Fantasy Calendar site.
  3. Check moon phase at last day of year 1 and first day of year 2.
  4. Check Leap Year dialogue box in calendar settings within Calendarium.
  5. The Json can also be uploaded to Fantasy Calendar to see the expected behavior and directly compare.

FC Json: ancient-israelite-calendar.zip Produced Calendarium MD: _data.md

Which Operating Systems are you using?

Obsidian Version Check

1.3.5

Plugin Version

b12

Confirmation

Possible solution

No response

Suleiman212 commented 1 year ago

Thinking about the leap day stuff, it seems like FC has two ways of inputting leap days, either on an interval with an offset, or on set years of a cycle (you switch between them with a checkbox). Looking at the calendar editor within Calendarium itself, it seems like it doesn't have these two settings, instead it just has the first, and so when I set up leap days using the second in FC, it is being misinterpreted as the first and breaking. But it seems to me like the second case can easily be expressed in terms of the first; for example, having a 5 year cycle with a leap day on the 2nd and 4th year, is the same as one leap day with a 5 year interval offset 2 years, and one with a 5 year interval offset 4 years. So currently Calendarium imports interval as interval, then cycle as offset, when importing the second kind of leap days, but really it should be switched to be importing interval as offset then cycle as interval.

Suleiman212 commented 1 year ago

Okay manually setting that up seems to have fixed both the leap day problem and also my moon problem... Not sure how they were related, but maybe the leap days, when improperly defined, were overlapping or doing something weird and causing the moon to skip around...?

valentine195 commented 1 year ago

Moon phase calculation is based on the number of days before the current day, so having leap days occurring or not occuring will change moon phases.

Suleiman212 commented 1 year ago

The strange thing was that the calendar was only showing one leap day occurring, but seemed to be pushing the moon phases forward many days, as if the leap day had occurred multiple times on top of each other. So month increased from 29 to 30 days, but then the next month started about 9 days worth of phases.

pixel7777 commented 6 months ago

I just added the plugin and am unable to create moons. Is the idea that the moons have to be created in Fantasy Calendar and then displayed here? Is the preferred methodology to create the calendar in Fantasy Calendar and then import it?

valentine195 commented 6 months ago

Hi @pixel7777 you should be able to create moons in the calendar creator thru settings. If you can’t, could you please open a new issue?

valentine195 commented 6 months ago

@pixel7777 The moon creation should be fixed with v1.0.10