Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Not sure I understand the question completely. Do you want to hide specific weekdays? Or do you want to restrict users to create events only for specific dates in a month?</p> <p>If you want to hide specific weekdays, you can do that easily by using the 'hiddenDays' property as explained here: <a href="http://arshaw.com/fullcalendar/docs/display/hiddenDays/" rel="nofollow">http://arshaw.com/fullcalendar/docs/display/hiddenDays/</a></p> <p>If what you want is to hide specific dates in a month, I don't think there is a provision to do so. But, you can instead use the 'dayClick' function to check if the clicked date is one on which you want the user to create events and if so, proceed from there otherwise let the user know that an event cannot be created on that specific date. The dayClick documentation can be found at: <a href="http://arshaw.com/fullcalendar/docs/mouse/dayClick/" rel="nofollow">http://arshaw.com/fullcalendar/docs/mouse/dayClick/</a></p> <p>Also you can use 'dayRender' to get a callback when a day is rendered (it is rendered as a table cell with 'td' tags for each date) so that you can add a CSS class (such as 'disabled' for dates with no event creation allowed) to the specific cell of the calendar after checking it's date in order to let the user know whether an event can be created on that specific date. Documentation for this can be found here: <a href="http://arshaw.com/fullcalendar/docs/display/dayRender/" rel="nofollow">http://arshaw.com/fullcalendar/docs/display/dayRender/</a></p> <p>EDIT-- (Edited after OP comment...)</p> <p>From your comment, I gather the situation is rather tricky. As you rightly mentioned, the agendaWeek does not have a 'dayRender' callback. The only option I can think of is to cobble together a rather dirty hack. From what I could find, the structure of the agendaWeek (for the latest fullcalendar version) is something like below:</p> <pre><code>&lt;table class="fc-agenda-days fc-border-separate"&gt; &lt;thead&gt; &lt;tr class="fc-first fc-last"&gt; &lt;th class="fc-agenda-axis fc-widget-header fc-first"&gt;&amp;nbsp;&lt;/th&gt; &lt;th class="fc-sun fc-col0 fc-widget-header"&gt;Sun 8/11&lt;/th&gt; &lt;th class="fc-mon fc-col1 fc-widget-header"&gt;Mon 8/12&lt;/th&gt; &lt;th class="fc-mon fc-col2 fc-widget-header"&gt;Tue 8/13&lt;/th&gt; ... &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr class="fc-first fc-last"&gt; &lt;th class="fc-agenda-axis fc-widget-header fc-first"&gt;&amp;nbsp;&lt;/th&gt; &lt;td class="fc-col0 fc-sun fc-widget-content fc-past"&gt;...&lt;/td&gt; &lt;td class="fc-col1 fc-mon fc-widget-content fc-past"&gt;...&lt;/td&gt; &lt;td class="fc-col2 fc-tue fc-widget-content fc-past"&gt;...&lt;/td&gt; .... &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>If somehow you can parse the dates in $("table.fc-agenda-days th.fc-col*") and for dates that you want disabled, add a CSS class to $("table.fc-agenda-days td.fc-col*") that sets a new background, you should be good to go. This is of course in addition to handling the 'dayClick' callback.</p> <p>This can be done in the 'viewRender' callback (after checking if the view type is agendaWeek). Hope this pushes you in the right direction... Let me know if you get stuck somewhere...</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload