# Calculate the financial year, with the supplied date
def get_financial_year(opts={})
date = opts[:date].is_a?(Date)? opts[:date] : Time.now.to_date
...
Ruby Getting financial year
by https://www.google.com/accounts/o8/id?id=AItOawkXhagloEt9LaGYb5TnfYmraHmMC8fzlsE,
March 12, 2012 22:47,
6 refactorings, tagged with rails, ruby, date
#MM-YYYY
"2011-10".split("-").reverse.join("/") => "10/2011"
Ruby parsing date
anyone has the better solut...
def self.at_beginning_of_interval(time, interval_type)
#simple substraction does not (seem) to work for long intervals (summer/winter time ?)
#and at_beginning_of_hour is not defined
...
Ruby At beginning of interval
This code was necessary sin...
def first_day_of_month(selected_date) ...
Ruby Splitting array into define...
I'm mainly interested in op...
def date(date, time = false)
date = Date.parse(date) if date.is_a? String
day = date.strftime('%d')
...
Ruby Human Date Method
Seems like this method coul...
class Article < ActiveRecord::Base # Find all articles in the given date range based on the published_at field ...
Ruby Building a dynamic date range
I've got a route that handl...
I'm trying to get the finan...