simple_calendar 0.1.10 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +3 -2
- data/lib/simple_calendar/version.rb +1 -1
- data/lib/simple_calendar/view_helpers.rb +3 -2
- data/spec/simple_calendar_spec.rb +10 -2
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b46fa1a91f987c5e308a4bf435365dd6ae4bee1b
|
4
|
+
data.tar.gz: 71cf6c5d9b33d48cad89d779fff7df6603506c45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d9d0a0aea3af9d70a2d29a421bca603c18cbb24d4ab4516e3aa9ad9213303a2b406bba420607e9a96a117682e3f101964093ac41d013900c9bed18c193c0b40
|
7
|
+
data.tar.gz: 8ce4d3ebcf32cf966c69e92391e5518152d83ce91a6ae602063fad7ede933b289b76a5374856744e286d0e619c88b1c83944b20f1af1fa65af29d380516f25d2
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -92,14 +92,15 @@ links (which are normally set to « («) and » (»)
|
|
92
92
|
|
93
93
|
Possible options:
|
94
94
|
|
95
|
-
:year
|
96
|
-
:month
|
95
|
+
:year # current year, default: from params or current year
|
96
|
+
:month # current month, default: from params or current month
|
97
97
|
:prev_text # previous month link text, default: «
|
98
98
|
:next_text # next month link text, default: »
|
99
99
|
:start_day # starting day of week, default: :sunday
|
100
100
|
:empty_date # block called when a date is empty
|
101
101
|
:class # HTML class attribute for the calendar
|
102
102
|
:params # Any extra params you'd like in the URL (automatically includes month and year)
|
103
|
+
:dont_display_year #Set to true to remove the year in the table header
|
103
104
|
|
104
105
|
If you wish to have Monday as the first day of the week, you'll need to
|
105
106
|
change a couple things. First, when rendering the calendar, use the
|
@@ -25,7 +25,8 @@ module SimpleCalendar
|
|
25
25
|
:start_day => :sunday,
|
26
26
|
:class => "table table-bordered table-striped calendar",
|
27
27
|
:params => {},
|
28
|
-
:time_selector => "start_time"
|
28
|
+
:time_selector => "start_time",
|
29
|
+
:dont_display_year => false
|
29
30
|
}
|
30
31
|
end
|
31
32
|
# Returns array of dates between start date and end date for selected month
|
@@ -103,7 +104,7 @@ module SimpleCalendar
|
|
103
104
|
tags = []
|
104
105
|
|
105
106
|
tags << month_link(options[:prev_text], previous_month, options[:params], {:class => "previous-month"})
|
106
|
-
tags << "#{I18n.t("date.month_names")[selected_month.month]} #{selected_month.year}"
|
107
|
+
tags << "#{I18n.t("date.month_names")[selected_month.month]} #{selected_month.year unless options[:dont_display_year]}".strip
|
107
108
|
tags << month_link(options[:next_text], next_month, options[:params], {:class => "next-month"})
|
108
109
|
|
109
110
|
tags.join.html_safe
|
@@ -79,9 +79,17 @@ describe "SimpleCalendar" do
|
|
79
79
|
subject.should_receive(:month_link).exactly(2)
|
80
80
|
selected_month = Date.new(2013, 1)
|
81
81
|
options = {}
|
82
|
-
|
83
|
-
subject.send(:month_header, selected_month, options).should match(/^<h2/)
|
82
|
+
subject.send(:month_header, selected_month, options).should match(/^<h2>January 2013<\/h2>/)
|
84
83
|
end
|
84
|
+
|
85
|
+
it "should allow the display_year option to be set to false and not show the year" do
|
86
|
+
subject.should_receive(:month_link).exactly(2)
|
87
|
+
selected_month = Date.new(2014, 1)
|
88
|
+
options = {:dont_display_year => true}
|
89
|
+
str = subject.send(:month_header, selected_month, options)
|
90
|
+
str.should match(/^<h2>January<\/h2>/)
|
91
|
+
end
|
92
|
+
|
85
93
|
end
|
86
94
|
|
87
95
|
describe "#month_link" do
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_calendar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Oliver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '3.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '3.0'
|
27
27
|
description: A simple Rails 3 calendar
|
@@ -31,8 +31,8 @@ executables: []
|
|
31
31
|
extensions: []
|
32
32
|
extra_rdoc_files: []
|
33
33
|
files:
|
34
|
-
- .gitignore
|
35
|
-
- .rspec
|
34
|
+
- ".gitignore"
|
35
|
+
- ".rspec"
|
36
36
|
- Gemfile
|
37
37
|
- README.md
|
38
38
|
- Rakefile
|
@@ -53,17 +53,17 @@ require_paths:
|
|
53
53
|
- lib
|
54
54
|
required_ruby_version: !ruby/object:Gem::Requirement
|
55
55
|
requirements:
|
56
|
-
- -
|
56
|
+
- - ">="
|
57
57
|
- !ruby/object:Gem::Version
|
58
58
|
version: '0'
|
59
59
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
|
-
- -
|
61
|
+
- - ">="
|
62
62
|
- !ruby/object:Gem::Version
|
63
63
|
version: '0'
|
64
64
|
requirements: []
|
65
65
|
rubyforge_project: simple_calendar
|
66
|
-
rubygems_version: 2.
|
66
|
+
rubygems_version: 2.2.2
|
67
67
|
signing_key:
|
68
68
|
specification_version: 4
|
69
69
|
summary: A simple Rails 3 calendar
|