Issue 1448: function opt(name, viewNameOverride) fails for array options
Status:  Invalid
Owner: ----
Closed:  Aug 2013
Reported by jamshe...@gmail.com, Jun 25, 2012
Hello, I am trying to extend the fullcalendar by passing in an array where each element is an object with 'start' and 'end' dates of available time for use in agenda views.  So someone available from 8 - 5 with an hour lunch at noon would have two elements in the array, one from 8 - 12, one from 1 - 5.

But when I try to access my new option with the 'opt' function, it fails.  Same when I try to access existing array options like 'monthNames'.

If you look in the function, the problem is that an array passes the condition "if (typeof v == 'object')".  So then it tries to return the result of the smartProperty function, which doesn't work out.

Here is the code I am using now to check for array type and return it if so:

        function opt(name, viewNameOverride) {
            var v = options[name];
            if ($.isArray(v)) {
                return v;
            }
            if (typeof v == 'object') {
                return smartProperty(v, viewNameOverride || viewName);
            }
            return v;
        }

Please let me know if that change is not in keeping with the existing architecture.  Or there may be a better way to do this by just changing the conditional to check if v is something more specific that would fail and so the function would then just return v.

Thanks for the amazing plugin.
Aug 18, 2013
Project Member #1 adamrs...@gmail.com
(No comment was entered for this change.)
Status: ReproTemp
Aug 25, 2013
Project Member #2 adamrs...@gmail.com
This message is being bulk-sent to a number of issues, both [very] old and new.

I have been working on taming this issue tracker, which has gotten out of control after months of neglect. You are receiving this message because I could not successfully reproduce the bug you were reporting with a reasonable amount of effort. I have written some new bug-report guidelines to be used by all bug reports going forward:

    http://arshaw.com/fullcalendar/wiki/Report-a-Bug/

Its salient point is that all bug reports should have an isolated demonstration, viewable online with a tool like JSFiddle.

If the bug you originally reported is still important to you, could you please first try the latest version of FullCalendar and see if it is fixed? If not, could you please file a NEW bug report that follows the new guidelines? This issue will not be monitored for further comments.

I'm sorry I have taken so long to respond to many of your request, and I'm sorry if this new procedure causes extra work for you. Going forward, the issue tracker will be much more of a well-oiled machine.

Again, if you must, PLEASE SUBMIT A *NEW* BUG REPORT (following the new guidelines) INSTEAD OF COMMENTING ON THIS ONE. Further comments on this report will be ignored. Thanks.
Status: Invalid
Labels: Type-Bug