"But you now need to be able to black out dates from a date picker per school and per service?"
That's correct, Walter. 5 calendars, 1 for each service, displayed using conditional logic. The calendar view is being filtered by school (40 schools and counting) using a custom user meta field. There's one page per service where the schools can view the calendars with detail links to see details for each service assignment. The schools can only see their own data. It works great but the client wants a date picker to have dates blacked out based on school AND service.
I have suggested they generate a physical services calendar (or 5, 1 for each service) for each school and have the user view a physical document to determine availability of services at their school when selecting the date in the referral form. It's not ideal but neither is 200 calendars (5 services x 40 schools). A single calendar for all schools and all services that can be filtered to display the relevant options would be better... assuming there's not a more automated solution.
Thanks for understanding/restating the problem. 90% of problem solving is problem seeing!
<script> $(document).ready(function(){ var startDate, endDate, dateRange = []; $("#field_bitf").datepicker({ dateFormat : 'yy-mm-dd', onSelect: function (date) { startDate = $(this).datepicker("getDate"); } }); $("#field_ivea1").datepicker({ dateFormat : 'yy-mm-dd', onSelect: function (date) { endDate = $(this).datepicker("getDate"); for (var d = new Date(startDate); d <= new Date(endDate); d.setDate(d.getDate() + 1)) { dateRange.push($.datepicker.formatDate('yy-mm-dd', d)); } } }); $("#field_bitf, #field_ivea1").datepicker("setDate", new Date()); $('#field_kxnt7').datepicker({ beforeShowDay: function (date) { var dateString = jQuery.datepicker.formatDate('yy-mm-dd', date); console.log(dateString); return [dateRange.indexOf(dateString) == -1]; } }); }); </script>
Thanks, Walter. I'll play with this. One of my original goals for this site was to keep it simple and rely exclusively on existing plugins. I wanted to make the site turnkey for the NFP so they could maintain the system internally with some basic training. Things are starting to get a bit more complicated!
Please login or Register to submit your answer
After watching the Simply Schedule Appointments (SSA) FF integration video, I suspect my best case scenario might be to create 40 SSA schedules (1 per school) with each schedule offering five courses and the calendar for each of the five courses displaying the appropriate blackout (or available) dates. I would display the appropriate schedule using conditional logic where school site = school site. Just thinking aloud.
Is all of the data on one calendar now or are you posting a calendar for each school and filtering it some way? Couldn't you use view parameters dynamically to populate the calendars for the filter and then the school?
[display-frm-data id=x filter=limited school="webster"]
I am using one calendar for each service (there are 5) and using conditional logic to display the calendar corresponding with the selected service. I am filtering the calendar view using "School Site is equal to [user_meta key=user_school_site]". There are five separate Calendar views filtered the same way and it all works perfectly.
My problem is I cannot offer the user a calendar control (date picker) with blackout dates because each school will have different blackout dates and those blackout dates will vary between the five different services.
I don't think there is any way to avoid at least one calendar for each school site and I will need to include five types of services for each calendar. I think it can be done using Simply Schedule Appointments and its integration with FF, I'm still researching the Simply Schedule Appointments plugin.
It's a real head scratcher.