fiscali 2.4.0 → 2.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MTMwYWM4M2YzYmQzMjAxM2ExNGNlOGMyMTcxYzEyYjM5MmJlMGMzMg==
4
+ YzliMjVhMjczMmVkNDc2ZGI4M2I1ZTZkMTQ3ZjZiY2JhMjJhZTgzYg==
5
5
  data.tar.gz: !binary |-
6
- YWY1NDM3MTdjZjFkNWJmN2Y1MDkwYjM2OTlmZTFkNGVjM2NjZWE0OA==
6
+ OGNlMGI0MzJkMTRiYWRkYWVjOTQ3YWU5NmFlNmIyMjkyMzMwZGFjNg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OTkxMzYyNDYyZDYzZWZlY2NmMzI1ZGZlMjRlZTAwNTVkNjQxZmUzZjFkYWI0
10
- MWVkMmU1OWJlM2ZmNjUzOTAyYjQwZmUzMTJkZmM3ZWU1MGUwOWI3NzU2YjRl
11
- OTc5ODY4ZDZlNWVlYjk5NzM1ZTFjODBhMTQzYTJjYmZiMzIwMDI=
9
+ OWEwMGNlNzFjNjA0MDAwZGQ0NDM2ZDJiNmMzYTZiN2I3ZTE5NjM4MTY2OTM4
10
+ OTRmZGVlZGE1MzNjMDE1ODgyOGEwZmQ1MThhOTZjMmU2NTlmMTM0NDMzMjYy
11
+ ZTZhN2ExZDVlM2E5MTAxMmFmN2U1MDZhNmFjNjZjZjFjY2JmMTA=
12
12
  data.tar.gz: !binary |-
13
- MTI4MDkwODI4ZjYyOTM3ZmMwZTk0MDA0ZTk0OTkzYjRmNzNjMGNjODIxOGYx
14
- Mzc4OTEyMjU2YWYyMWZlYzQ1MGMwNTNjNjEzYTQ5MmE0MjlmMjhhZDQwZjY1
15
- MGZkZTdjODAxZWI1ZWRiOWVlNWZkNDUyNWVlNTFlODk3MDdmNzk=
13
+ M2QwNGE2Y2JkZjU0ZWMzODJhZDI0YzViMjQ5N2EwYWQyYTNmZjcwODRjODJi
14
+ MjE1NjI1Y2QzZGQ3YmFlZmVhNGMwMTg0NzNkNjJiMDJmZjVjZDBmMGY0YTU5
15
+ YTEyMGExY2Y5Y2I1NGZjYzQ3YTM5YWE5MTM3MjlkMTM3MTNjNDI=
data/README.markdown CHANGED
@@ -1,55 +1,67 @@
1
1
  # Fiscali: Fiscal Year based calculations
2
2
 
3
- Fiscali provides ONE thing:
3
+ Fiscali provides methods on your Date and Time classes to jump around dates in your Financial Year.
4
4
 
5
- * Additional methods on your Date and Time classes to jump around dates in your Financial Year.
6
- * Not sure it's a point to be said, but YES, you can specify your financial year zone and if you dont know your zone, just provide the first month your financial year to the Date/Time class.
5
+ You can specify your financial year zone and if you don’t know your zone, just provide the month your financial year begins.
7
6
 
8
7
  ## Quick Links
9
8
 
10
- * [Wiki](http://wiki.github.com/asanghi/fiscali)
11
- * [Bugs](http://github.com/asanghi/fiscali/issues)
12
- * [Donate](http://pledgie.org/campaigns/5400)
9
+ * [Wiki](https://github.com/asanghi/fiscali/wiki)
10
+ * [Bugs](https://github.com/asanghi/fiscali/issues)
11
+ * [Donate](https://pledgie.org/campaigns/5400)
13
12
 
14
13
  ## Installing
15
14
 
16
- sudo gem install fiscali
15
+ gem install fiscali
17
16
 
18
17
  ## Using in your Rails project
19
18
 
20
- In Rails projects, include the gem in the Gemfile and run "bundle install" to install the gem.
19
+ In Rails projects, include Fiscali in the Gemfile, and run `bundle install` to install the gem:
21
20
 
22
- gem "fiscali"
21
+ gem 'fiscali'
23
22
 
24
- Next step is to provide your Date/Time class your start zone. Stick this in an initializer file. (If you didnt understand that, put it in $ENV[RAILS_ROOT]/config/initializers/fiscali.rb)
23
+ Next, create an initializer for configuration Fiscali:
24
+
25
+ config/initializers/fiscali.rb
26
+
27
+ Either provide your Date/Time class your start zone:
25
28
 
26
29
  Date.fiscal_zone = :india
27
- Time.fiscal_zone = :india
28
- or
29
- Date.start_month = 4
30
30
 
31
- you can also determine the default for Year Forward by adding this to the same initializer file:
31
+ Or if set the exact start month—for example, April:
32
+
33
+ Date.fy_start_month = 4
34
+
35
+ You can also determine the default for Year Forward by adding this to the same initializer file:
32
36
 
33
37
  Date.use_forward_year!
34
38
  Time.use_forward_year!
35
39
 
36
- or if you wish to revert back to the default
40
+ To revert back to the default:
37
41
 
38
42
  Date.reset_forward_year!
39
43
  Time.reset_forward_year!
40
44
 
41
- Year Forward refers to the standard name for a fiscal year. For example:
42
- * If FY 2008 spans 2008 - 2009, set to false or don't include in initializer file.
43
- * If FY 2008 spans 2007 - 2008, set to true in initializer file.
45
+ Year Forward refers to the standard name for a fiscal year. For example:
46
+
47
+ * If FY 2008 spans 2008–2009, set to false or don’t include in initializer file.
48
+ * If FY 2008 spans 2007–2008, set to true in initializer file.
49
+
50
+ Note that for every configuration you make, you will need to make it to every class (Date, Time, and DateTime) independently. For example:
51
+
52
+ Date.fiscal_zone = :india
53
+ Time.fiscal_zone = :india
54
+ DateTime.fiscal_zone = :india
44
55
 
45
56
  ### Default options
46
57
 
47
- By default, the financial year start in January. (Correct me, but thats not a common start of financial year!)
48
- Known Zones are -
58
+ By default, the financial year start in January.
59
+
60
+ Supported zones are:
49
61
 
50
- {:india => 4, :uk => 4, :us => 10, :pakistan => 7, :australia => 7, :ireland => 1, :nz => 7, :japan => 4}
62
+ { india: 4, uk: 4, us: 10, pakistan: 7, australia: 7, ireland: 1, nz: 7, japan: 4}
51
63
 
52
- By default, the Year Forward option is set to false, meaning the term FY 2008 spans 2008-2009 years.
64
+ By default, the year forward is false, meaning the term FY 2008 spans 20082009 years.
53
65
 
54
66
  ## Date or Time Class Methods
55
67
 
@@ -84,8 +96,6 @@ By default, the Year Forward option is set to false, meaning the term FY 2008 sp
84
96
  Date.uses_forward_year?
85
97
  => true
86
98
 
87
-
88
-
89
99
  If you want to add your own fiscal zone
90
100
 
91
101
  RisingSun::Fiscali::FISCAL_ZONE.merge!(:my_own_zone => 2)
@@ -102,15 +112,17 @@ should do the trick.
102
112
  Indian Fiscal Year starts from 1st of April
103
113
  Assume Date.today is 1st May 2009
104
114
 
105
-
106
115
  ##### financial_year -> Returns the financial year of the date/time
116
+
107
117
  Date.today.financial_year
108
118
  => 2009
109
119
  Date.today.beginning_of_year.financial_year
110
120
  => 2008
111
- Since 1st Jan 2009 in India falls in the 2008-09 financial year
121
+
122
+ Since 1st Jan 2009 in India falls in the 2008-09 financial year
112
123
 
113
124
  ##### beginning_of_financial_year -> Returns the beginning of financial year
125
+
114
126
  Date.today.beginning_of_financial_year
115
127
  => 1st April 2009
116
128
  Date.today.beginning_of_year.beginning_of_financial_year
@@ -201,6 +213,7 @@ Assume Date.today is 1st May 2009
201
213
 
202
214
  ## Contributors
203
215
 
216
+ * [@moubry](https://github.com/moubry)
204
217
  * [@reed](https://github.com/reed)
205
218
  * [@chiperific](https://github.com/chiperific)
206
219
  * [@rshallit](https://github.com/rshallit)
@@ -1,5 +1,5 @@
1
1
  module RisingSun
2
2
  module Fiscali
3
- VERSION = "2.4.0"
3
+ VERSION = "2.4.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fiscali
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aditya Sanghi