Hi all,
Thanks to Zick and the folks at Interactive Tools, the Calendar project is moving forward nicely. I’ll be posting a revised set of files and documentation shortly.
Before I do, there's one more issue that I’d like to solve, and that’s the automatic listing of non-consecutive event dates on a detail page.
THE SCTION EDITOR
In the multi-record section called “events”, there’s a date field for the starting date (start_date), there’s a date field for the ending date (end_date) and there are 7 day of the week check boxes that determine the days on which a repeating event occurs.
Here are a few scenarios...
Using a simple if statement, if an event occurs on a single date, only the start date field would be filled in and I can show that field on my detail page.
If there’s an event that spans a number of consecutive days, both the start_date and an end_date field would be filled in and I can show those on my detail page.
THE PROBLEM
Where I’m having a problem is when an event spans a number of days, but occurs only on Tuesdays and Wednesdays (the “Tuesday” and “Wednesday” checkboxes are checked).
How can I generate a list on the detail page that shows only the Tuesdays and Wednesdays that the event occurs?
I’m thinking that the logic might be something like:
For each date in the date range between the start date and the end date, check to see if the day matches a day that is checked, and if it does, show that date.
But the coding eludes me.
Any help appreciated and I’ll include the result in the revised docs.
Thanks,
Jerry Kornbluth
The first CMS Builder reference book is now available on-line!
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php