Module: Timely

Defined in:
lib/timely/trackable_date_set.rb,
lib/timely.rb,
lib/timely/date.rb,
lib/timely/time.rb,
lib/timely/range.rb,
lib/timely/string.rb,
lib/timely/version.rb,
lib/timely/date_time.rb,
lib/timely/week_days.rb,
lib/timely/date_range.rb,
lib/timely/rails/time.rb,
lib/timely/time_since.rb,
lib/timely/date_chooser.rb,
lib/timely/rails/period.rb,
lib/timely/rails/season.rb,
lib/timely/rails/date_group.rb,
lib/timely/rails/extensions.rb,
lib/timely/rails/calendar_tag.rb,
lib/timely/temporal_patterns/finder.rb,
lib/timely/temporal_patterns/pattern.rb,
lib/timely/temporal_patterns/interval.rb,
lib/timely/temporal_patterns/frequency.rb,
lib/timely/rails/date_range_validity_module.rb

Overview

Track a set of dates (usually a range)

Tracking means to remember whether each date has been worked on, or ‘done’.

range = Date.current..(Date.current+10)
my_dates = TrackableDateSet.new(range)

my_dates.set_date_done!(Date.current)
my_dates.set_dates_done!([Date.current+1, Date.current+2])
my_dates.set_all_done!

As well as tracking status of individual dates, you can also remember whether any action has been applied or not across the whole set:

my_dates = TrackableDateSet.new(Date.current..(Date.current+10))

my_dates.apply_action(:minimum_nights_surcharge)
my_dates.action_applied?(:minimum_nights_surcharge)   # will be true

Defined Under Namespace

Modules: ActionViewHelpers, Date, DateRangeValidityModule, DateTime, Extensions, Rails, Range, String, TemporalPatterns, Time, TimeSince Classes: DateChooser, DateChooserException, DateFormatException, DateGroup, DateRange, Period, Season, TrackableDateSet, WeekDays

Constant Summary collapse

VERSION =
'0.8.0'

Class Method Summary collapse

Class Method Details

.current_dateObject

Uses Date.current to be more accurate for Rails applications



5
6
7
# File 'lib/timely/rails/calendar_tag.rb', line 5

def self.current_date
  ::Date.respond_to?(:current) ? ::Date.current : ::Date.today
end

.loadObject



24
25
26
# File 'lib/timely.rb', line 24

def self.load
  ::Time.send :include, Timely::Time
end