     window.location.href = "#{@newUrl}&#{$.param(@selection)}"
 
   initialViewType: (linkParam, defaultType) ->
-    type = @forceDay() && 'day' || linkParam || @savedSettings().viewType || defaultType || 'week'
+    type = @forceDay() && 'day' || linkParam || @savedSettings.viewType || defaultType || 'week'
     @URL_PARAMS_TO_VIEW_TYPES[type]
 
   permalink: ->


    nearest

  savedSettings: ->
    settings = JSON.parse(window.localStorage.getItem(@storageKey) || '{}')

    # currentDate setting expires after one hour

    @ruleSet = options.ruleSet
    @resourceId = options.resourceId
    @storageKey = "calendar#{@resourceId}Settings"
    @savedSettings = @loadSettings()

    @calendar.fullCalendar
      events: options.feedUrl
      defaultView: @initialViewType(options.viewType, options.defaultViewType)
      defaultDate: options.focusDate || @savedSettings.currentDate
      height: 700
      allDaySlot: false
      eventOverlap: false
