Summary
Added the pre-Oct 1582 restriction on the reusable calendar. (Working version, Update 4 version)
Essentially, the addition from Update 3 is the function checkRestraint()
, where it checks the date being dragged or clicked on to see if it should be set to Oct 1582 or let it be.
I also used the checkRestraint()
function to make the cursor look normal when the mouse is over a date that should not be available, even though they can click on it, but it would just move to Oct 1582.
Check it out and let me know if it the functions don’t work properly or intuitively.
Notes
I thought this would be (understatedly) a bit complicated because it would involve a lot of if-else statements concerning which year digit is available. (For example, if the first year digit is 1, the second year digit has to be more than or equal to 5. But if the third digit is 7, the second year digit can only be more than 5. This is just the simpler one of conditions.) I even drew out those probability charts to figure out the settings for each digits based on what the other digits are.
But it turns out that I can take the shorter road, and set the conditions based on if it a) is earlier than 1582 (where I would force the date display to move to Oct 1582), b) is 1582 (at which point, I would split to pre-October and October-on), and c) after 1582 (where any date is possible.)
So if you try to click on, or drag a strip to a date before October 1582, you’d get sent to October 1582 and get a message telling you why. This is all experiments mode, so the delivery and presentations are still up for changes. But the basic functions are pretty set.
1 thought on “Reusable Calendar Project Update 4”