The Mercurian Empire http://hermertia.com/ |
|
New and improved calendar http://hermertia.com/viewtopic.php?f=14&t=1008 |
Page 1 of 4 |
Author: | The Regent [ August 30th, 2016, 7:14 pm ] |
Post subject: | New and improved calendar |
Greetings all. The old calendar had some errors. I have since fixed it. This old code: Code: <?php $day = date('d'); $mercannum = $day / 6; $base_year = -2; if ($mercannum >= 0 && $mercannum < 1) { $extra_year = $base_year; } else if ($mercannum >= 1 && $mercannum < 2) { $extra_year = $base_year +1; } else if ($mercannum >= 2 && $mercannum < 3) { $extra_year = $base_year +2; } else if ($mercannum >= 3 && $mercannum < 4) { $extra_year = $base_year +3; } else if ($mercannum >= 4 && $mercannum < 5) { $extra_year = $base_year +4; } Should be changed to: Code: <?php
$day = date('d'); //today $mercannum = $day / 6; $base_year = -2; //for tweaking if ($day >= 0 && $day < 1) { //saves extra years to be added into months below. $extra_year = $base_year; } else if ($day >= 6 && $day < 11) { $extra_year = $base_year +1; } else if ($day >= 11 && $day < 16) { $extra_year = $base_year +2; } else if ($day >= 16 && $day < 21) { $extra_year = $base_year +3; } else if ($day >= 21 && $day < 26) { $extra_year = $base_year +4; } else if ($day >= 26) { $extra_year = $base_year +5; } |
Author: | The Regent [ August 30th, 2016, 7:17 pm ] |
Post subject: | Re: New and improved calendar |
Also, I created a Calendar Converter! Huzah! http://codydodd.ca/hermertia/cal.php I put it behind a clickable button so we can add this to our own header. I will add source code as a message after, or we can work on uploading it together Siden? I'll be checking in and out all week for you during the mornings and afternoons. Hope it works out. |
Author: | Joren [ August 30th, 2016, 9:29 pm ] |
Post subject: | Re: New and improved calendar |
Wow, that is really neat! Having the calendar (and now the converter) is going to make it so much easier to keep track of lore dates for everyone. |
Author: | Scrios V [ August 31st, 2016, 3:42 am ] |
Post subject: | Re: New and improved calendar |
So awesome! |
Author: | Petra Ravnikaar [ August 31st, 2016, 9:16 pm ] |
Post subject: | Re: New and improved calendar |
Most excellent work, Regent of Minerva! Your people have produced some fine work since returning to the fold of the Empire from obscurity. |
Author: | The Regent [ September 10th, 2016, 4:14 pm ] |
Post subject: | Re: New and improved calendar |
Bumping. Out of curiosity, has the new code been uploaded to fix the header? I can't tell. The calendar converter is optional, but super cool and I suggest if we don't embed it directly into the header behind a small button, then at least we should permalink it. But: question, if we are in a new cycle, we are at 00-00 instead of 01-03, right? |
Author: | The Regent [ September 10th, 2016, 4:16 pm ] |
Post subject: | Re: New and improved calendar |
Or rather, 00-03? If so, let me make a quick revision |
Author: | Cerdic Accynnafon [ September 10th, 2016, 4:16 pm ] |
Post subject: | Re: New and improved calendar |
It should be 00-03, correct. |
Author: | King Erastil [ September 10th, 2016, 4:32 pm ] |
Post subject: | Re: New and improved calendar |
I thought the cycle started this month, so shouldn't it be 00-00 or 00-01 |
Author: | Cerdic Accynnafon [ September 10th, 2016, 4:34 pm ] |
Post subject: | Re: New and improved calendar |
No, as Gimpy made an excellent argument for when the website went down and info was lost: The Mercannum is tied to the IRL month. September is always 03. |
Page 1 of 4 | All times are UTC [ DST ] |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |