lib/timeboss/calendar.rb in timeboss-1.0.5 vs lib/timeboss/calendar.rb in timeboss-1.1.0

- old
+ new

@@ -33,14 +33,14 @@ def title name.titleize end # Can this calendar support weeks? - # For custom calendars, this value can generally not be overridden. - # But for calendars like our Gregorian implementation, weeks are irrelevant, and should be suppressed. + # To support weeks, a calendar must implement a `#weeks_in(year:)` method that returns an array of + # `Calendar::Week` objects. # @return [Boolean] def supports_weeks? - true + respond_to?(:weeks_in) end def self.register! return unless TimeBoss::Calendars.method_defined?(:register) TimeBoss::Calendars.register(name.to_s.demodulize.underscore, self)