Skip to content

Commit

Permalink
fixed front page financial_year_formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
tetrahedra committed Oct 10, 2015
1 parent 63e0515 commit b4f9e6a
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions helpers/formatters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,20 @@ def format_query_string(s)
URI.escape(s)
end

def financial_year_formatter(y)

#date = if(d.kind_of?(String)) then
#Date.parse d
#else
#d
#end

#if date.month < 4
#{}"FY#{(date.year-1).to_s[2..3]}/#{date.year.to_s[2..3]}"
#else
"FY#{y.to_s[2..3]}/#{(y+1).to_s[2..3]}"
#end
def financial_year_formatter(d)

date = if(d.kind_of?(String)) then
Date.parse d
else
d
end

if date.month < 4
"FY#{(date.year-1).to_s[2..3]}/#{date.year.to_s[2..3]}"
else
"FY#{date.year.to_s[2..3]}/#{(date.year+1).to_s[2..3]}"
end
end

def financial_year
now = Time.new
Expand Down

0 comments on commit b4f9e6a

Please sign in to comment.