SWADE Playlist
Page 18 of 18 First ... 8161718
  1. #171
    I've been having issues adding leap years to my calendar.
    I'm trying to do something similar to the Gregorian, but extra days on years that are multiples of two (instead of four), not multiples of 10 (instead of 100) except for multiples of 50(instead of 400).
    Unfortunately, the extra days are not being added.
    Experimentally, I've tried applying rollover days and that appears to work, however I do not want them.
    Attached Files Attached Files

  2. #172
    Quote Originally Posted by Berwind View Post
    I've been having issues adding leap years to my calendar.
    I'm trying to do something similar to the Gregorian, but extra days on years that are multiples of two (instead of four), not multiples of 10 (instead of 100) except for multiples of 50(instead of 400).
    Unfortunately, the extra days are not being added.
    Experimentally, I've tried applying rollover days and that appears to work, however I do not want them.
    You are missing a <periodvarcalc> tag in your module db.xml.

    For example, in the gregorian calendar you have both a lunardaycalc tag so that the days of the week line up correctly on the calendar (ie, if Feb 28 is a Wed, then Mar 1 is a Thur). And it has a periodvarcalc to add days to Feb when the conditions are correct.

    Code:
    				<lunardaycalc type="string">MKgregorian</lunardaycalc>
    				<lunarweek>
    					<day1 type="string">Sunday</day1>
    					<day2 type="string">Monday</day2>
    					<day3 type="string">Tuesday</day3>
    					<day4 type="string">Wednesday</day4>
    					<day5 type="string">Thursday</day5>
    					<day6 type="string">Friday</day6>
    					<day7 type="string">Saturday</day7>
    				</lunarweek>
    				<periodvarcalc type="string">MKgregorian</periodvarcalc>
    Your code only has a lunardaycalc, which is never being used/called because you are not registering a lunar day handler. you are registering a monthvar handler which should be defined in the periodvarcalc tag. I recommend you rename the lunardaycalc tag to periodvarcalc and it should start adding the leap years according to your code.

  3. #173
    Quote Originally Posted by mattekure View Post
    You are missing a <periodvarcalc> tag in your module db.xml.

    For example, in the gregorian calendar you have both a lunardaycalc tag so that the days of the week line up correctly on the calendar (ie, if Feb 28 is a Wed, then Mar 1 is a Thur). And it has a periodvarcalc to add days to Feb when the conditions are correct.

    Code:
    				<lunardaycalc type="string">MKgregorian</lunardaycalc>
    				<lunarweek>
    					<day1 type="string">Sunday</day1>
    					<day2 type="string">Monday</day2>
    					<day3 type="string">Tuesday</day3>
    					<day4 type="string">Wednesday</day4>
    					<day5 type="string">Thursday</day5>
    					<day6 type="string">Friday</day6>
    					<day7 type="string">Saturday</day7>
    				</lunarweek>
    				<periodvarcalc type="string">MKgregorian</periodvarcalc>
    Your code only has a lunardaycalc, which is never being used/called because you are not registering a lunar day handler. you are registering a monthvar handler which should be defined in the periodvarcalc tag. I recommend you rename the lunardaycalc tag to periodvarcalc and it should start adding the leap years according to your code.
    That was it. I was so focused on the LUA I didn't catch my mistake in the db.XML.
    Thanks for the extra set of eyes!

  4. #174
    I want to do the Mayan calendar which has two calendars that interlink and the same day combination only repeats every 52 years.

  5. #175
    Quote Originally Posted by Deathloc View Post
    I want to do the Mayan calendar which has two calendars that interlink and the same day combination only repeats every 52 years.
    There is no way currently to run two calendars. You would have to write an extension to add that functionality

  6. #176
    Mach5RR's Avatar
    Join Date
    Jun 2019
    Location
    San Diego, CA
    Posts
    49
    Out of curiosity, does anyone know how to do a month with two different lengths of the week (7 day/8 day)?

    We have a setting that has a 7 day week, a fortnight which consists of two weeks with a Festival day inbetween, and a month that consists of two fortnights (30 days). I figured the easiest way is to code the first and third week as 8 days, and the 2nd and 4th as 7 day weeks.
    Right now, our workaround is to just make a 15 day week, with seven of the days repeating themselves. But this is ... inelegant to look at.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
FG Spreadshirt Swag

Log in

Log in