The graceful date handler !
It gives you dates like, middle of the month, middle of next month etc.
Installation
Add this line to your application's Gemfile:
gem 'tareek'
And then execute:
$ bundle
Or install it yourself as:
$ gem install tareek
Usage
Returns middle date of next month of the specified year
Tareek::Dates.get_middle_of_next_month_date(2014,3) #=> "2014-04-15"
Returns middle date of past month of specified year
Tareek::Dates.get_middle_of_past_month_date(2014,3) #=> "2014-02-14"
Returns day of middle date of next month of the specified year
Tareek::Dates.day_middle_of_next_month_date(2014,3) #=> "Tuesday"
Returns day of the middle date of past month of specified year
Tareek::Dates.day_middle_of_past_month_date(2014,3) #=> "Friday"
Returns date for next specified weekday
Tareek::Dates.date_of_next("Sunday") ##=>> 'Sunday'
Returns humanized date without day
Tareek::Dates.humanize_without_day('1/12/2014') #=> "Dec 14"
Returns humanized date with day
Tareek::Dates.humanize_with_day('1/12/2014') #=> "01-Dec-14"
Returns time in the date
Tareek::Dates.time_at_day('1/12/2014') #=> "12:00 AM"
Returns omniture formatted date with time
Tareek::Dates.omniture_formated_with_time('1/12/2014') #=> "12/01/2014 12:00:00 AM"
Contributing
- Fork it ( http://github.com//tareek/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request