Plugins - day_questions
Add to favoritesday_questions
day_questions adds helper methods for determining if a specified date/time was yesterday, today, or tomorrow.
Resources
API
Bugs
Development
Source
- git://github.com/pluginaweek/_questions.git
Usage
Predicate methods
>> 1.day.ago.yesterday? => true >> Time.now.today? => true >> 1.day.from_now.tomorrow? => true >> 1.day.from_now.around_today? => true
Date/Time formatting
In addition to the predicate methods, there also exists a helper method to output a humanized version of the current day which will return "Yesterday", "Today", "Tomorrow" or a custom date format if it is outside the range of around today. See PluginAWeek::DayQuestions::Date#human_day for more information.
Tips
With the addition of the interpolated_time_formats[http://github.com/pluginaweek/interpolated_time_formats] plugin, you can output a string version of the time/date with human_day like so:
>> Time.now.strftime('#{human_day} at #{hour}')
=> "Today at 5"
Dependencies
None.
http://github.com/pluginaweek/_questions
git://github.com/pluginaweek/_questions.git
Rails' (MIT)
Misc. Enhancements
