TimDaub / simple-caldav

caldav in JavaScript; made easy.
20 stars 3 forks source link

Add date ranges and support RRULEs #43

Open lxg opened 1 year ago

lxg commented 1 year ago

This code adds two features:

  1. Adding support for date range queries; works like this:
(async () => {
  const list = await dav.listEvents(
    SimpleCalDAV.simplifyEvent,
    {
      start: new Date("2022-12-20T00:00:00"),
      end: new Date("2022-12-30T00:00:00")
    }
  )
  1. Adding support for recurring events (RRULE entries), using the rrule library. To be honest, the code is a bit messy at this point; but I think the whole library would need a refactoring anyway. Also I need to mention that the code assumes that the result of the transform callback is an object with start and end properties, which might not be desireable.

So, please feel free to use this code as you see fit.

By the way, I very much appreciate your previous work, especially that you have implemented it with explicit support for Radicale!

TimDaub commented 1 year ago

wow, this is a really nice addition! I‘d be happy to merge this. Can you please add unit tests to the code portions that you added?