PDA

View Full Version : Help with formatting .lua file for a calendar with an intercalary month



CallMeTheFalcon
October 22nd, 2021, 08:40
I'm currently working on drafting a custom calendar for my world and I'm about 95% of the way finished, but I keep running into issues with the implementation of an intercalary month. Specifically, I'm having issues with the day of the week being properly calculated for the month immediately proceeding the intercalary month.

I want the intercalary month to last 5 days (6 days in a leap year that occurs every 4 years), and I want this month to occur between the 6th and 7th months of the calendar. The days of the week line up as they should through the first 6 months and the intercalary month (e.g. the last day of a month being a Friday leads to the first day of the next month being a Monday), but when the intercalary month ends, the first day in the 7th month of the calendar resets to whatever the first day was for the start of the year. For example, in year 1, the intercalary month ends on a Friday, but then the 7th month begins on a Wednesday.

What changes will I have to make to the .lua file to get the days to display properly?

I have attached the .lua file and the db.xml files for the calendar to this post, but I have provided the specific details of the calendar below should they be needed:


Total Months: 12
Days per month: 30
Days in intercalary month: 5 (6 during leap years that occur every 4 years)
Days per week: 7

CallMeTheFalcon
October 23rd, 2021, 04:45
Alright, so a quick update: I was able to figure out how to code the week days to read correctly, but now I'm running into a different issue. When I'm outputting the date, Fantasy Grounds is adding the wrong suffix to certain days of the month. Specifically, it is changing the 11th, 12th, and 13th to the 11st, 12nd, and 13rd respectively. Is there any way to fix this? I have attached a screenshot of the issue if that helps.

LordEntrails
October 23rd, 2021, 04:52
Lots of calendar customization tips in this thread. Plus if you post there Mattekure is likely to see it and jump in to help. https://www.fantasygrounds.com/forums/showthread.php?47885-Fantasy-Grounds-Custom-Calendar-Tutorial

CallMeTheFalcon
October 25th, 2021, 01:27
Thanks! I'll post my issue there.