     lastModification: type: String
     caldavuri   : type: String
 
-require('cozy-ical').decorateEvent Event
+ical.decorateEvent Event
+
 
 Event.all = (params, callback) ->
     Event.request "all", params, callback
 
+
 Event.byCalendar = (calendarId, callback) ->
     Event.request 'byCalendar', key: calendarId, callback
+
+
+Event.getInRange = (options, callback) ->
+    Event.request 'byDate', options, callback
+
 
 Event.createOrUpdate = (data, callback) ->
     {id} = data

                    details: data.details
                , (err) ->
                    event.beforeUpdate = oldValue
                    callback err, event
            else
                callback null, event
        else
            Event.create data, callback

Event.getInRange = (options, callback) ->
    Event.request 'byDate', options, callback

            or data.details isnt event.details
                # clone object
                oldValue = event.toJSON() # clone the object properties
                changes.update = true
                event.updateAttributes
                    start: data.start
                    end: data.end
