cal 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cal/monthly_calendar.rb +2 -2
- data/lib/cal/version.rb +1 -1
- data/spec/cal/monthly_calendar_spec.rb +3 -3
- metadata +1 -1
data/lib/cal/monthly_calendar.rb
CHANGED
@@ -22,14 +22,14 @@ module Cal
|
|
22
22
|
new month.year, month.number, options
|
23
23
|
end
|
24
24
|
|
25
|
-
def from_param(param)
|
25
|
+
def from_param(param, options = {})
|
26
26
|
year, month_number = if param.present?
|
27
27
|
param.split '-'
|
28
28
|
else
|
29
29
|
now = Date.current
|
30
30
|
[now.year, now.month]
|
31
31
|
end
|
32
|
-
new year, month_number
|
32
|
+
new year, month_number, options
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
data/lib/cal/version.rb
CHANGED
@@ -7,7 +7,7 @@ describe Cal::MonthlyCalendar do
|
|
7
7
|
|
8
8
|
describe "from_month" do
|
9
9
|
it "returns a calendar for the month's year and month number" do
|
10
|
-
subject.from_month(Cal::Month.new(2012, 11)).should == subject.new(2012, 11)
|
10
|
+
subject.from_month(Cal::Month.new(2012, 11), :start_week_on => :tuesday).should == subject.new(2012, 11, :start_week_on => :tuesday)
|
11
11
|
end
|
12
12
|
|
13
13
|
it "raises an error without something that can be converted to a month" do
|
@@ -19,8 +19,8 @@ describe Cal::MonthlyCalendar do
|
|
19
19
|
|
20
20
|
describe "from_param" do
|
21
21
|
it "is the calendar for the given param" do
|
22
|
-
calendar = subject.new 2012, 5
|
23
|
-
subject.from_param(calendar.to_param).should == calendar
|
22
|
+
calendar = subject.new 2012, 5, :start_week_on => :tuesday
|
23
|
+
subject.from_param(calendar.to_param, :start_week_on => :tuesday).should == calendar
|
24
24
|
end
|
25
25
|
|
26
26
|
context "with a blank param" do
|