simple_calendar 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -93,6 +93,7 @@ Possible options:
93
93
  :prev_text # previous month link text, default: «
94
94
  :next_text # next month link text, default: »
95
95
  :start_day # starting day of week, default: :sunday
96
+ :empty_date # block called when a date is empty
96
97
 
97
98
  If you wish to have Monday as the first day of the week, you'll need to
98
99
  change a couple things. First, when rendering the calendar, use the
@@ -1,3 +1,3 @@
1
1
  module SimpleCalendar
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -76,9 +76,15 @@ module SimpleCalendar
76
76
  content_tag(:td, :class => td_class.join(" "), :'data-date-iso'=>date.to_s, 'data-date'=>date.to_s.gsub('-', '/')) do
77
77
  content_tag(:div) do
78
78
  divs = []
79
-
80
79
  concat content_tag(:div, date.day.to_s, :class=>"day_number")
81
- divs << day_events(date, events).collect { |event| block.call(event) }
80
+
81
+ cur_events = day_events(date, events)
82
+ if cur_events.empty? && options[:empty_date]
83
+ concat options[:empty_date].call
84
+ else
85
+ divs << cur_events.collect{ |event| block.call(event) }
86
+ end
87
+
82
88
  divs.join.html_safe
83
89
  end #content_tag :div
84
90
  end #content_tag :td
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_calendar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-13 00:00:00.000000000 Z
12
+ date: 2013-02-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -57,7 +57,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
57
57
  version: '0'
58
58
  segments:
59
59
  - 0
60
- hash: -1583268356881306530
60
+ hash: 391670376766325657
61
61
  required_rubygems_version: !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
@@ -66,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
66
  version: '0'
67
67
  segments:
68
68
  - 0
69
- hash: -1583268356881306530
69
+ hash: 391670376766325657
70
70
  requirements: []
71
71
  rubyforge_project: simple_calendar
72
72
  rubygems_version: 1.8.24