period_dates 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 74b25c3bf9ff655f61f865f426c4eaacc2444cc1
4
- data.tar.gz: 1e2a955ef80a22e5d48c9d2f9f531dfe54258da6
3
+ metadata.gz: 29c59d7d9ff79f03fe498e427d758b90a8247913
4
+ data.tar.gz: 3e02c2873c0297fbd74c894b737c4d9c4513ce51
5
5
  SHA512:
6
- metadata.gz: 2fdaedc8b1a5f8f371968c47131f584d1d021adc7e1a11d530f8685cfeba85261a1c34de993a00816b6b6ec2e33136c09a04957ef3ac7acf9cd690a11dbc4f1f
7
- data.tar.gz: c2b0ad0aaa4daf76195c8d80a9aa17b63dceebcffc0f69e251e68b7903d3cbb7c3d571f3987a67368e7e23559b485c6024be10b9cc95bb97b9bdee44de04564c
6
+ metadata.gz: 2ae7c57317f8b2f632f02661d916f91f9fe13524e0e4a8892539521055ec79a9311ae37d7fa4d6fa81c303143c67e032ebdbe6e51ca6ab8220cc1b05e4dfeb56
7
+ data.tar.gz: 7d0e043229d67f4131f6ab7192a8b3e4358e5c3d6379e76fe0572038c22e992cdf9b354ac06ed36ca8858a9f800e8224f2900c831512befc866c1691b5c11cbe
@@ -84,7 +84,7 @@ module Calculations
84
84
  end
85
85
 
86
86
  def offset_period_dates(offset=0,period='monthly')
87
- bound_dates = self.current_period_dates
87
+ bound_dates = self.current_period_dates(period)
88
88
 
89
89
  if !available_periods.include?(period)
90
90
  raise PeriodDatesIncorrectPeriod, "Period must be one of this: #{available_periods.join(', ')}."
@@ -1,3 +1,3 @@
1
1
  module PeriodDates
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -35,6 +35,12 @@ class CoreExtTest < ActiveSupport::TestCase
35
35
  dates = date.prev_period_dates('biannually')
36
36
  assert_equal dates[0], date_from
37
37
  assert_equal dates[1], date_to
38
+
39
+ date_from = DateTime.new(2015,1,1)
40
+ date_to = DateTime.new(2015,6,1).at_end_of_month
41
+ dates = date.offset_period_dates(0,'biannually')
42
+ assert_equal dates[0], date_from
43
+ assert_equal dates[1], date_to
38
44
  end
39
45
 
40
46
  def test_date_time_last_period_dates_4
@@ -1808,3 +1808,103 @@ CoreExtTest: test_date_time_offset_period_dates_3
1808
1808
  PeriodDatesTest: test_truth
1809
1809
  ---------------------------
1810
1810
   (0.1ms) rollback transaction
1811
+  (0.1ms) begin transaction
1812
+ ------------------------------------------------
1813
+ CoreExtTest: test_date_time_current_period_dates
1814
+ ------------------------------------------------
1815
+  (0.1ms) rollback transaction
1816
+  (0.1ms) begin transaction
1817
+ ---------------------------------------------
1818
+ CoreExtTest: test_date_time_last_period_dates
1819
+ ---------------------------------------------
1820
+  (0.1ms) rollback transaction
1821
+  (0.1ms) begin transaction
1822
+ -----------------------------------------------
1823
+ CoreExtTest: test_date_time_last_period_dates_2
1824
+ -----------------------------------------------
1825
+  (0.1ms) rollback transaction
1826
+  (0.1ms) begin transaction
1827
+ -----------------------------------------------
1828
+ CoreExtTest: test_date_time_last_period_dates_3
1829
+ -----------------------------------------------
1830
+  (0.2ms) rollback transaction
1831
+  (0.1ms) begin transaction
1832
+ -----------------------------------------------
1833
+ CoreExtTest: test_date_time_last_period_dates_4
1834
+ -----------------------------------------------
1835
+  (0.1ms) rollback transaction
1836
+  (0.1ms) begin transaction
1837
+ ---------------------------------------------
1838
+ CoreExtTest: test_date_time_next_period_dates
1839
+ ---------------------------------------------
1840
+  (0.1ms) rollback transaction
1841
+  (0.1ms) begin transaction
1842
+ -----------------------------------------------
1843
+ CoreExtTest: test_date_time_offset_period_dates
1844
+ -----------------------------------------------
1845
+  (0.1ms) rollback transaction
1846
+  (0.1ms) begin transaction
1847
+ -------------------------------------------------
1848
+ CoreExtTest: test_date_time_offset_period_dates_2
1849
+ -------------------------------------------------
1850
+  (0.1ms) rollback transaction
1851
+  (0.1ms) begin transaction
1852
+ -------------------------------------------------
1853
+ CoreExtTest: test_date_time_offset_period_dates_3
1854
+ -------------------------------------------------
1855
+  (0.1ms) rollback transaction
1856
+  (0.1ms) begin transaction
1857
+ ---------------------------
1858
+ PeriodDatesTest: test_truth
1859
+ ---------------------------
1860
+  (0.0ms) rollback transaction
1861
+  (0.1ms) begin transaction
1862
+ ---------------------------
1863
+ PeriodDatesTest: test_truth
1864
+ ---------------------------
1865
+  (0.1ms) rollback transaction
1866
+  (0.1ms) begin transaction
1867
+ ------------------------------------------------
1868
+ CoreExtTest: test_date_time_current_period_dates
1869
+ ------------------------------------------------
1870
+  (0.0ms) rollback transaction
1871
+  (0.0ms) begin transaction
1872
+ ---------------------------------------------
1873
+ CoreExtTest: test_date_time_last_period_dates
1874
+ ---------------------------------------------
1875
+  (0.1ms) rollback transaction
1876
+  (0.1ms) begin transaction
1877
+ -----------------------------------------------
1878
+ CoreExtTest: test_date_time_last_period_dates_2
1879
+ -----------------------------------------------
1880
+  (0.0ms) rollback transaction
1881
+  (0.0ms) begin transaction
1882
+ -----------------------------------------------
1883
+ CoreExtTest: test_date_time_last_period_dates_3
1884
+ -----------------------------------------------
1885
+  (0.0ms) rollback transaction
1886
+  (0.0ms) begin transaction
1887
+ -----------------------------------------------
1888
+ CoreExtTest: test_date_time_last_period_dates_4
1889
+ -----------------------------------------------
1890
+  (0.0ms) rollback transaction
1891
+  (0.1ms) begin transaction
1892
+ ---------------------------------------------
1893
+ CoreExtTest: test_date_time_next_period_dates
1894
+ ---------------------------------------------
1895
+  (0.0ms) rollback transaction
1896
+  (0.0ms) begin transaction
1897
+ -----------------------------------------------
1898
+ CoreExtTest: test_date_time_offset_period_dates
1899
+ -----------------------------------------------
1900
+  (0.1ms) rollback transaction
1901
+  (0.0ms) begin transaction
1902
+ -------------------------------------------------
1903
+ CoreExtTest: test_date_time_offset_period_dates_2
1904
+ -------------------------------------------------
1905
+  (0.0ms) rollback transaction
1906
+  (0.1ms) begin transaction
1907
+ -------------------------------------------------
1908
+ CoreExtTest: test_date_time_offset_period_dates_3
1909
+ -------------------------------------------------
1910
+  (0.1ms) rollback transaction
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: period_dates
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javi Fernández
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-11 00:00:00.000000000 Z
11
+ date: 2015-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: semester