No release in over a year
Get all events active at a timestamp for an icalendar file
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

Active icalendar events

Get all events that are active at a timestamp for an icalendar file.

This has been tested only with Google Calendar and seems to work for all the cases I can think of.

Possible future work:

  • Write some tests.
  • Check it works for calendars that don't start on Monday.
  • Check it works for calendars that are not Google Calendar. (Checked outlook.live.com but didn't seem to give timezone information in a useful way).
  • Validation of data/parameters.
  • Clean up module interface (currently just exposing all methods with module_function)
  • Specify timezone rather than assuming that server this is run on is in the same timezone as the calendar.
  • Enable rubocop
  • Enable CI

Example Usage

require 'active-icalendar-events'
require 'active_support'
require 'active_support/core_ext'
require 'open-uri'

ICAL_URL = ENV['ICAL_URL']

ical_data = URI::open(ICAL_URL)

datetime = ActiveSupport::TimeZone.new('Europe/London').now

active_events = ActiveIcalendarEvents::all_active_events(datetime, Icalendar::Calendar.parse(ical_data))

Run Tests

bundle exec rspec