class SmartTodo::Events::Date

An event that check if the passed date is passed

Public Class Methods

message(on_date) click to toggle source

@param on_date [String] @return [String]

# File lib/smart_todo/events/date.rb, line 21
def self.message(on_date)
  "We are past the *#{on_date}* due date and your TODO is now ready to be addressed."
end
met?(on_date) click to toggle source

@param on_date [String] a string parsable by Time.parse @return [String, false]

# File lib/smart_todo/events/date.rb, line 11
def self.met?(on_date)
  if Time.now >= Time.parse(on_date)
    message(on_date)
  else
    false
  end
end