asanghi / fiscali

Fiscal Year Date Functions

Home Page:http://asanghi.github.com/fiscali

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Date vs. DateTime

chiperific opened this issue · comments

commented

irb(main):005:0> @start_date = Date.new(2013,2,1) => Fri, 01 Feb 2013 irb(main):006:0> @start_date.financial_year #correct => 2013 irb(main):007:0> @start_date.beginning_of_financial_year => Mon, 01 Jul 2013 #correct irb(main):008:0> @second_date = DateTime.new(2013,2,1) => Fri, 01 Feb 2013 00:00:00 +0000 irb(main):009:0> @second_date.financial_year => 2014 #incorrect irb(main):010:0> @second_date.beginning_of_financial_year => Wed, 01 Jan 2014 00:00:00 +0000 #incorrect

Seems to struggle to differentiate between Date and DateTime, maybe?

Odd at first look! Do you mind submitting a pull request with a failing test?