GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: fork of Geoffrey Grosenbach's calendar_helper rails plugin (http://topfunky.net/svn/plugins/calendar_helper)
Clone URL: git://github.com/adzap/calendar_helper.git
fixed default month_name_text when non-default month used
adzap (author)
Wed Jun 18 13:55:16 -0700 2008
commit  85de244129cb63336929769108f430c92749f946
tree    2e5f592b1e51fd88bffc583dec79fa37c3cc5534
parent  d934d4924fd46697dac228a5cbaba28d3d268f1f
...
1
 
2
3
 
 
 
 
 
 
4
5
6
...
 
1
2
 
3
4
5
6
7
8
9
10
11
0
@@ -1,6 +1,11 @@
0
-=== 0.2.3 / 2008-06-11
0
+=== 0.3.1 / 2008-06-19
0
 
0
-* Removed gem spec to be just a plugin because this is now a fork of original gem.
0
+* Fixed month_name_text with non-default month [jaggederest]
0
+
0
+=== 0.3.0 / 2008-06-11
0
+
0
+* Forked plugin
0
+* Removed gem spec to be just a plugin.
0
 * Removed requirement for month and year. Defaults to current month and year.
0
 * Added option for :month_name_text to override presentation of month name.
0
 
...
3
4
5
6
 
7
8
9
...
79
80
81
82
83
84
85
86
 
 
87
88
89
...
3
4
5
 
6
7
8
9
...
79
80
81
 
82
83
84
85
86
87
88
89
90
0
@@ -3,7 +3,7 @@ require 'date'
0
 # CalendarHelper allows you to draw a databound calendar with fine-grained CSS formatting
0
 module CalendarHelper
0
 
0
- VERSION = '0.3'
0
+ VERSION = '0.3.0'
0
 
0
   # Returns an HTML calendar. In its simplest form, this method generates a plain
0
   # calendar (which can then be customized using CSS).
0
@@ -79,11 +79,12 @@ module CalendarHelper
0
       :first_day_of_week => 0,
0
       :accessible => false,
0
       :show_today => true,
0
- :month_name_text => Date::MONTHNAMES[Time.now.month],
0
       :previous_month_text => nil,
0
       :next_month_text => nil
0
     }
0
     options = defaults.merge options
0
+
0
+ options[:month_name_text] ||= Date::MONTHNAMES[options[:month]]
0
 
0
     first = Date.civil(options[:year], options[:month], 1)
0
     last = Date.civil(options[:year], options[:month], -1)
...
36
37
38
 
 
 
 
 
39
40
41
...
36
37
38
39
40
41
42
43
44
45
46
0
@@ -36,6 +36,11 @@ class CalendarHelperTest < Test::Unit::TestCase
0
     assert_match %r{>#{month_and_year}<}, calendar_with_defaults(:month_name_text => month_name + ' ' + Time.now.year.to_s)
0
   end
0
 
0
+ def test_month_name_text_is_correct_for_month
0
+ month_and_year = 'January'
0
+ assert_match %r{>#{month_and_year}<}, calendar_with_defaults(:month => 1)
0
+ end
0
+
0
   def test_custom_css_classes
0
     # Uses the key name as the CSS class name
0
     # :other_month_class is not implemented yet

Comments

    No one has commented yet.