# UKAcademicCalendar Designed to assist in Ruby programs dealing with the UK Academic Calendar, i.e. the Sept - Sept academic year, and the 3 'terms' (Autumn, Spring, Summer). ## Installation Add this line to your application's Gemfile: ```ruby gem 'uk_academic_calendar' ``` And then execute: $ bundle Or install it yourself as: $ gem install uk_academic_calendar ## Usage ```ruby require 'uk_academic_calendar' # Assuming today is 20th Jan 2024 Date.today.academic_year #=> 2023 Date.today.beginning_of_academic_year #=> 2023-09-01 Date.today.end_of_academic_year #=> 2024-08-31 # or... Time.now.academic_year #=> 2023 Time.now.beginning_of_academic_year #=> 2023-09-01 00:00:00 +0100 Time.now.end_of_academic_year #=> 2024-08-31 23:59:59.999999999 +0100 term_now = Date.today.academic_term #=> Spring 2023/2024 term_now.start_date #=> 2024-01-01 term_now.end_date #=> 2024-03-31, i.e. Easter Sunday term_now.start_date = '2025-01-01' #=> raises #UKAcademicCalendar::InvalidTermStart error term_now.to_range #=> (2024-01-01..2024-03-31) term_now.all_dates #=> #