date_select_separator 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +34 -0
- data/Rakefile +1 -0
- data/date_select_separator.gemspec +23 -0
- data/lib/date_select_separator.rb +72 -0
- data/lib/date_select_separator/version.rb +3 -0
- data/test/date_select_separator_test.rb +561 -0
- metadata +89 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 rono23
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# DateSelectSeparator
|
2
|
+
|
3
|
+
Add separators to data_select on Rails.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'date_select_separator'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
## Usage
|
16
|
+
|
17
|
+
# Add a separator after each select_tag
|
18
|
+
<%= f.date_select :birthday, use_month_numbers: true, use_separators: {year: '年', month: '月', day: '日'} %>
|
19
|
+
<%= f.datetime_select :birthday, use_month_numbers: true, time_separator: '', use_separators: {year: '年', month: '月', day: '日', hour: '時', minute: '分'} %>
|
20
|
+
|
21
|
+
# Add a separator to each option_tag. Month is used a value like ja.date.month_names in config/locales
|
22
|
+
<%= f.date_select :birthday, use_separators: {inline: true, year: '年', day: '日'} %>
|
23
|
+
<%= f.datetime_select :birthday, time_separator: '', use_separators: {inline: true, year: '年', day: '日', hour: '時', minute: '分'} %>
|
24
|
+
|
25
|
+
# Options: html_tag, class_prefix
|
26
|
+
<%= f.date_select :birthday, use_month_numbers: true, use_separators: {year: '年', month: '月', day: '日', html_tag: :div, class_prefix: 'prefix'} %>
|
27
|
+
|
28
|
+
## Contributing
|
29
|
+
|
30
|
+
1. Fork it
|
31
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
32
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
33
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
34
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'date_select_separator/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "date_select_separator"
|
8
|
+
spec.version = DateSelectSeparator::VERSION
|
9
|
+
spec.authors = ["rono23"]
|
10
|
+
spec.email = ["rono23@gmail.com"]
|
11
|
+
spec.description = %q{Add separators to data_select on Rails}
|
12
|
+
spec.summary = spec.description
|
13
|
+
spec.homepage = "https://github.com/rono23/date_select_separator"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency "rails", "~> 3.2.12"
|
22
|
+
spec.add_development_dependency "test-unit"
|
23
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require "date_select_separator/version"
|
2
|
+
|
3
|
+
module ActionView
|
4
|
+
module Helpers
|
5
|
+
class DateTimeSelector
|
6
|
+
def select_month_with_separator
|
7
|
+
separators = @options[:use_separators]
|
8
|
+
type = :month
|
9
|
+
select_tag = select_month_without_separator
|
10
|
+
|
11
|
+
if @options[:use_hidden].blank? && @options[:discard_month].blank? && use_separators?(separators, type) && separators[:inline].blank?
|
12
|
+
select_tag += content_tag_for_separator(separators, type)
|
13
|
+
end
|
14
|
+
|
15
|
+
select_tag
|
16
|
+
end
|
17
|
+
alias_method_chain :select_month, :separator
|
18
|
+
|
19
|
+
def build_options_and_select_with_separator(type, selected, options = {})
|
20
|
+
separators = @options[:use_separators]
|
21
|
+
|
22
|
+
if use_separators?(separators, type)
|
23
|
+
if separators[:inline]
|
24
|
+
options.merge!({:use_separator => separators[type]})
|
25
|
+
build_select(type, build_options_with_separator(selected, options))
|
26
|
+
else
|
27
|
+
select_tag = build_select(type, build_options(selected, options))
|
28
|
+
select_tag + content_tag_for_separator(separators, type)
|
29
|
+
end
|
30
|
+
else
|
31
|
+
build_options_and_select_without_separator(type, selected, options)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
alias_method_chain :build_options_and_select, :separator
|
35
|
+
|
36
|
+
private
|
37
|
+
def use_separators?(separators, type)
|
38
|
+
(separators.present? && separators[type].present?)
|
39
|
+
end
|
40
|
+
|
41
|
+
def build_options_with_separator(selected, options = {})
|
42
|
+
options = {
|
43
|
+
leading_zeros: true, ampm: false, use_two_digit_numbers: false, use_separator: false
|
44
|
+
}.merge!(options)
|
45
|
+
|
46
|
+
start = options.delete(:start) || 0
|
47
|
+
stop = options.delete(:end) || 59
|
48
|
+
step = options.delete(:step) || 1
|
49
|
+
leading_zeros = options.delete(:leading_zeros)
|
50
|
+
|
51
|
+
select_options = []
|
52
|
+
start.step(stop, step) do |i|
|
53
|
+
value = leading_zeros ? sprintf("%02d", i) : i
|
54
|
+
tag_options = { :value => value }
|
55
|
+
tag_options[:selected] = "selected" if selected == i
|
56
|
+
text = options[:use_two_digit_numbers] ? sprintf("%02d", i) : value
|
57
|
+
text = options[:ampm] ? AMPM_TRANSLATION[i] : text
|
58
|
+
text = options[:use_separator] ? text.to_s + options[:use_separator] : text
|
59
|
+
select_options << content_tag(:option, text, tag_options)
|
60
|
+
end
|
61
|
+
|
62
|
+
(select_options.join("\n") + "\n").html_safe
|
63
|
+
end
|
64
|
+
|
65
|
+
def content_tag_for_separator(separators, type)
|
66
|
+
separator_tag = separators[:html_tag] || :span
|
67
|
+
separator_class = (separators[:class_prefix] ? separators[:class_prefix] : "separator") + "_#{type}"
|
68
|
+
content_tag(separator_tag, separators[type], :class => separator_class)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,561 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
$LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
|
4
|
+
|
5
|
+
require "test/unit"
|
6
|
+
require 'action_view'
|
7
|
+
require 'date_select_separator'
|
8
|
+
|
9
|
+
class DateSelectSeparatorTest < ActionView::TestCase
|
10
|
+
|
11
|
+
silence_warnings do
|
12
|
+
Post = Struct.new("Post", :id, :written_on, :updated_at)
|
13
|
+
Post.class_eval do
|
14
|
+
def id
|
15
|
+
123
|
16
|
+
end
|
17
|
+
def id_before_type_cast
|
18
|
+
123
|
19
|
+
end
|
20
|
+
def to_param
|
21
|
+
'123'
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_select_day
|
27
|
+
expected = %(<select id="date_day" name="date[day]">\n)
|
28
|
+
expected << %(<option value="1">1</option>\n<option value="2">2</option>\n<option value="3">3</option>\n<option value="4">4</option>\n<option value="5">5</option>\n<option value="6">6</option>\n<option value="7">7</option>\n<option value="8">8</option>\n<option value="9">9</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16" selected="selected">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n<option value="24">24</option>\n<option value="25">25</option>\n<option value="26">26</option>\n<option value="27">27</option>\n<option value="28">28</option>\n<option value="29">29</option>\n<option value="30">30</option>\n<option value="31">31</option>\n)
|
29
|
+
expected << "</select>\n"
|
30
|
+
|
31
|
+
assert_dom_equal expected, select_day(Time.mktime(2003, 8, 16))
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_select_day_with_custom_separator
|
35
|
+
expected = %(<select id="date_day" name="date[day]">\n)
|
36
|
+
expected << %(<option value="1">1</option>\n<option value="2">2</option>\n<option value="3">3</option>\n<option value="4">4</option>\n<option value="5">5</option>\n<option value="6">6</option>\n<option value="7">7</option>\n<option value="8">8</option>\n<option value="9">9</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16" selected="selected">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n<option value="24">24</option>\n<option value="25">25</option>\n<option value="26">26</option>\n<option value="27">27</option>\n<option value="28">28</option>\n<option value="29">29</option>\n<option value="30">30</option>\n<option value="31">31</option>\n)
|
37
|
+
expected << "</select>\n"
|
38
|
+
expected << %(<span class="separator_day">日</span>)
|
39
|
+
|
40
|
+
assert_dom_equal expected, select_day(Time.mktime(2003, 8, 16), :use_separators => {:day => '日'})
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_select_month
|
44
|
+
expected = %(<select id="date_month" name="date[month]">\n)
|
45
|
+
expected << %(<option value="1">January</option>\n<option value="2">February</option>\n<option value="3">March</option>\n<option value="4">April</option>\n<option value="5">May</option>\n<option value="6">June</option>\n<option value="7">July</option>\n<option value="8" selected="selected">August</option>\n<option value="9">September</option>\n<option value="10">October</option>\n<option value="11">November</option>\n<option value="12">December</option>\n)
|
46
|
+
expected << "</select>\n"
|
47
|
+
|
48
|
+
assert_dom_equal expected, select_month(Time.mktime(2003, 8, 16))
|
49
|
+
end
|
50
|
+
|
51
|
+
def test_select_month_with_custom_separator
|
52
|
+
expected = %(<select id="date_month" name="date[month]">\n)
|
53
|
+
expected << %(<option value="1">January</option>\n<option value="2">February</option>\n<option value="3">March</option>\n<option value="4">April</option>\n<option value="5">May</option>\n<option value="6">June</option>\n<option value="7">July</option>\n<option value="8" selected="selected">August</option>\n<option value="9">September</option>\n<option value="10">October</option>\n<option value="11">November</option>\n<option value="12">December</option>\n)
|
54
|
+
expected << "</select>\n"
|
55
|
+
expected << %(<span class="separator_month">月</span>)
|
56
|
+
|
57
|
+
assert_dom_equal expected, select_month(Time.mktime(2003, 8, 16), :use_separators => {:month => '月'})
|
58
|
+
end
|
59
|
+
|
60
|
+
def test_select_year
|
61
|
+
expected = %(<select id="date_year" name="date[year]">\n)
|
62
|
+
expected << %(<option value="2003" selected="selected">2003</option>\n<option value="2004">2004</option>\n<option value="2005">2005</option>\n)
|
63
|
+
expected << "</select>\n"
|
64
|
+
|
65
|
+
assert_dom_equal expected, select_year(Time.mktime(2003, 8, 16), :start_year => 2003, :end_year => 2005)
|
66
|
+
end
|
67
|
+
|
68
|
+
def test_select_year_with_custom_separator
|
69
|
+
expected = %(<select id="date_year" name="date[year]">\n)
|
70
|
+
expected << %(<option value="2003" selected="selected">2003</option>\n<option value="2004">2004</option>\n<option value="2005">2005</option>\n)
|
71
|
+
expected << "</select>\n"
|
72
|
+
expected << %(<span class="separator_year">年</span>)
|
73
|
+
|
74
|
+
assert_dom_equal expected, select_year(Time.mktime(2003, 8, 16), :start_year => 2003, :end_year => 2005, :use_separators => {:year => '年'})
|
75
|
+
end
|
76
|
+
|
77
|
+
def test_select_hour
|
78
|
+
expected = %(<select id="date_hour" name="date[hour]">\n)
|
79
|
+
expected << %(<option value="00">00</option>\n<option value="01">01</option>\n<option value="02">02</option>\n<option value="03">03</option>\n<option value="04">04</option>\n<option value="05">05</option>\n<option value="06">06</option>\n<option value="07">07</option>\n<option value="08" selected="selected">08</option>\n<option value="09">09</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n)
|
80
|
+
expected << "</select>\n"
|
81
|
+
|
82
|
+
assert_dom_equal expected, select_hour(Time.mktime(2003, 8, 16, 8, 4, 18))
|
83
|
+
end
|
84
|
+
|
85
|
+
def test_select_hour_with_custom_separator
|
86
|
+
expected = %(<select id="date_hour" name="date[hour]">\n)
|
87
|
+
expected << %(<option value="00">00</option>\n<option value="01">01</option>\n<option value="02">02</option>\n<option value="03">03</option>\n<option value="04">04</option>\n<option value="05">05</option>\n<option value="06">06</option>\n<option value="07">07</option>\n<option value="08" selected="selected">08</option>\n<option value="09">09</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n)
|
88
|
+
expected << "</select>\n"
|
89
|
+
expected << %(<span class="separator_hour">時</span>)
|
90
|
+
|
91
|
+
assert_dom_equal expected, select_hour(Time.mktime(2003, 8, 16, 8, 4, 18), :use_separators => {:hour => '時'})
|
92
|
+
end
|
93
|
+
|
94
|
+
def test_select_minute
|
95
|
+
expected = %(<select id="date_minute" name="date[minute]">\n)
|
96
|
+
expected << %(<option value="00">00</option>\n<option value="01">01</option>\n<option value="02">02</option>\n<option value="03">03</option>\n<option value="04" selected="selected">04</option>\n<option value="05">05</option>\n<option value="06">06</option>\n<option value="07">07</option>\n<option value="08">08</option>\n<option value="09">09</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n<option value="24">24</option>\n<option value="25">25</option>\n<option value="26">26</option>\n<option value="27">27</option>\n<option value="28">28</option>\n<option value="29">29</option>\n<option value="30">30</option>\n<option value="31">31</option>\n<option value="32">32</option>\n<option value="33">33</option>\n<option value="34">34</option>\n<option value="35">35</option>\n<option value="36">36</option>\n<option value="37">37</option>\n<option value="38">38</option>\n<option value="39">39</option>\n<option value="40">40</option>\n<option value="41">41</option>\n<option value="42">42</option>\n<option value="43">43</option>\n<option value="44">44</option>\n<option value="45">45</option>\n<option value="46">46</option>\n<option value="47">47</option>\n<option value="48">48</option>\n<option value="49">49</option>\n<option value="50">50</option>\n<option value="51">51</option>\n<option value="52">52</option>\n<option value="53">53</option>\n<option value="54">54</option>\n<option value="55">55</option>\n<option value="56">56</option>\n<option value="57">57</option>\n<option value="58">58</option>\n<option value="59">59</option>\n)
|
97
|
+
expected << "</select>\n"
|
98
|
+
|
99
|
+
assert_dom_equal expected, select_minute(Time.mktime(2003, 8, 16, 8, 4, 18))
|
100
|
+
end
|
101
|
+
|
102
|
+
def test_select_minute_with_custom_separator
|
103
|
+
expected = %(<select id="date_minute" name="date[minute]">\n)
|
104
|
+
expected << %(<option value="00">00</option>\n<option value="01">01</option>\n<option value="02">02</option>\n<option value="03">03</option>\n<option value="04" selected="selected">04</option>\n<option value="05">05</option>\n<option value="06">06</option>\n<option value="07">07</option>\n<option value="08">08</option>\n<option value="09">09</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n<option value="24">24</option>\n<option value="25">25</option>\n<option value="26">26</option>\n<option value="27">27</option>\n<option value="28">28</option>\n<option value="29">29</option>\n<option value="30">30</option>\n<option value="31">31</option>\n<option value="32">32</option>\n<option value="33">33</option>\n<option value="34">34</option>\n<option value="35">35</option>\n<option value="36">36</option>\n<option value="37">37</option>\n<option value="38">38</option>\n<option value="39">39</option>\n<option value="40">40</option>\n<option value="41">41</option>\n<option value="42">42</option>\n<option value="43">43</option>\n<option value="44">44</option>\n<option value="45">45</option>\n<option value="46">46</option>\n<option value="47">47</option>\n<option value="48">48</option>\n<option value="49">49</option>\n<option value="50">50</option>\n<option value="51">51</option>\n<option value="52">52</option>\n<option value="53">53</option>\n<option value="54">54</option>\n<option value="55">55</option>\n<option value="56">56</option>\n<option value="57">57</option>\n<option value="58">58</option>\n<option value="59">59</option>\n)
|
105
|
+
expected << "</select>\n"
|
106
|
+
expected << %(<span class="separator_minute">分</span>)
|
107
|
+
|
108
|
+
assert_dom_equal expected, select_minute(Time.mktime(2003, 8, 16, 8, 4, 18), :use_separators => {:minute => '分'})
|
109
|
+
end
|
110
|
+
|
111
|
+
def test_select_second
|
112
|
+
expected = %(<select id="date_second" name="date[second]">\n)
|
113
|
+
expected << %(<option value="00">00</option>\n<option value="01">01</option>\n<option value="02">02</option>\n<option value="03">03</option>\n<option value="04">04</option>\n<option value="05">05</option>\n<option value="06">06</option>\n<option value="07">07</option>\n<option value="08">08</option>\n<option value="09">09</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16">16</option>\n<option value="17">17</option>\n<option value="18" selected="selected">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n<option value="24">24</option>\n<option value="25">25</option>\n<option value="26">26</option>\n<option value="27">27</option>\n<option value="28">28</option>\n<option value="29">29</option>\n<option value="30">30</option>\n<option value="31">31</option>\n<option value="32">32</option>\n<option value="33">33</option>\n<option value="34">34</option>\n<option value="35">35</option>\n<option value="36">36</option>\n<option value="37">37</option>\n<option value="38">38</option>\n<option value="39">39</option>\n<option value="40">40</option>\n<option value="41">41</option>\n<option value="42">42</option>\n<option value="43">43</option>\n<option value="44">44</option>\n<option value="45">45</option>\n<option value="46">46</option>\n<option value="47">47</option>\n<option value="48">48</option>\n<option value="49">49</option>\n<option value="50">50</option>\n<option value="51">51</option>\n<option value="52">52</option>\n<option value="53">53</option>\n<option value="54">54</option>\n<option value="55">55</option>\n<option value="56">56</option>\n<option value="57">57</option>\n<option value="58">58</option>\n<option value="59">59</option>\n)
|
114
|
+
expected << "</select>\n"
|
115
|
+
|
116
|
+
assert_dom_equal expected, select_second(Time.mktime(2003, 8, 16, 8, 4, 18))
|
117
|
+
end
|
118
|
+
|
119
|
+
def test_select_second_with_custom_separator
|
120
|
+
expected = %(<select id="date_second" name="date[second]">\n)
|
121
|
+
expected << %(<option value="00">00</option>\n<option value="01">01</option>\n<option value="02">02</option>\n<option value="03">03</option>\n<option value="04">04</option>\n<option value="05">05</option>\n<option value="06">06</option>\n<option value="07">07</option>\n<option value="08">08</option>\n<option value="09">09</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16">16</option>\n<option value="17">17</option>\n<option value="18" selected="selected">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n<option value="24">24</option>\n<option value="25">25</option>\n<option value="26">26</option>\n<option value="27">27</option>\n<option value="28">28</option>\n<option value="29">29</option>\n<option value="30">30</option>\n<option value="31">31</option>\n<option value="32">32</option>\n<option value="33">33</option>\n<option value="34">34</option>\n<option value="35">35</option>\n<option value="36">36</option>\n<option value="37">37</option>\n<option value="38">38</option>\n<option value="39">39</option>\n<option value="40">40</option>\n<option value="41">41</option>\n<option value="42">42</option>\n<option value="43">43</option>\n<option value="44">44</option>\n<option value="45">45</option>\n<option value="46">46</option>\n<option value="47">47</option>\n<option value="48">48</option>\n<option value="49">49</option>\n<option value="50">50</option>\n<option value="51">51</option>\n<option value="52">52</option>\n<option value="53">53</option>\n<option value="54">54</option>\n<option value="55">55</option>\n<option value="56">56</option>\n<option value="57">57</option>\n<option value="58">58</option>\n<option value="59">59</option>\n)
|
122
|
+
expected << "</select>\n"
|
123
|
+
expected << %(<span class="separator_second">秒</span>)
|
124
|
+
|
125
|
+
assert_dom_equal expected, select_second(Time.mktime(2003, 8, 16, 8, 4, 18), :use_separators => {:second => '秒'})
|
126
|
+
end
|
127
|
+
|
128
|
+
def test_select_date
|
129
|
+
expected = %(<select id="date_first_year" name="date[first][year]">\n)
|
130
|
+
expected << %(<option value="2003" selected="selected">2003</option>\n<option value="2004">2004</option>\n<option value="2005">2005</option>\n)
|
131
|
+
expected << "</select>\n"
|
132
|
+
|
133
|
+
expected << %(<select id="date_first_month" name="date[first][month]">\n)
|
134
|
+
expected << %(<option value="1">January</option>\n<option value="2">February</option>\n<option value="3">March</option>\n<option value="4">April</option>\n<option value="5">May</option>\n<option value="6">June</option>\n<option value="7">July</option>\n<option value="8" selected="selected">August</option>\n<option value="9">September</option>\n<option value="10">October</option>\n<option value="11">November</option>\n<option value="12">December</option>\n)
|
135
|
+
expected << "</select>\n"
|
136
|
+
|
137
|
+
expected << %(<select id="date_first_day" name="date[first][day]">\n)
|
138
|
+
expected << %(<option value="1">1</option>\n<option value="2">2</option>\n<option value="3">3</option>\n<option value="4">4</option>\n<option value="5">5</option>\n<option value="6">6</option>\n<option value="7">7</option>\n<option value="8">8</option>\n<option value="9">9</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16" selected="selected">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n<option value="24">24</option>\n<option value="25">25</option>\n<option value="26">26</option>\n<option value="27">27</option>\n<option value="28">28</option>\n<option value="29">29</option>\n<option value="30">30</option>\n<option value="31">31</option>\n)
|
139
|
+
expected << "</select>\n"
|
140
|
+
|
141
|
+
assert_dom_equal expected, select_date(Time.mktime(2003, 8, 16), :start_year => 2003, :end_year => 2005, :prefix => "date[first]")
|
142
|
+
end
|
143
|
+
|
144
|
+
def test_select_date_with_custom_separators
|
145
|
+
expected = %(<select id="date_first_year" name="date[first][year]">\n)
|
146
|
+
expected << %(<option value="2003" selected="selected">2003</option>\n<option value="2004">2004</option>\n<option value="2005">2005</option>\n)
|
147
|
+
expected << "</select>\n"
|
148
|
+
expected << %(<span class="separator_year">年</span>)
|
149
|
+
|
150
|
+
expected << %(<select id="date_first_month" name="date[first][month]">\n)
|
151
|
+
expected << %(<option value="1">January</option>\n<option value="2">February</option>\n<option value="3">March</option>\n<option value="4">April</option>\n<option value="5">May</option>\n<option value="6">June</option>\n<option value="7">July</option>\n<option value="8" selected="selected">August</option>\n<option value="9">September</option>\n<option value="10">October</option>\n<option value="11">November</option>\n<option value="12">December</option>\n)
|
152
|
+
expected << "</select>\n"
|
153
|
+
expected << %(<span class="separator_month">月</span>)
|
154
|
+
|
155
|
+
expected << %(<select id="date_first_day" name="date[first][day]">\n)
|
156
|
+
expected << %(<option value="1">1</option>\n<option value="2">2</option>\n<option value="3">3</option>\n<option value="4">4</option>\n<option value="5">5</option>\n<option value="6">6</option>\n<option value="7">7</option>\n<option value="8">8</option>\n<option value="9">9</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16" selected="selected">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n<option value="24">24</option>\n<option value="25">25</option>\n<option value="26">26</option>\n<option value="27">27</option>\n<option value="28">28</option>\n<option value="29">29</option>\n<option value="30">30</option>\n<option value="31">31</option>\n)
|
157
|
+
expected << "</select>\n"
|
158
|
+
expected << %(<span class="separator_day">日</span>)
|
159
|
+
|
160
|
+
assert_dom_equal expected, select_date(Time.mktime(2003, 8, 16), :start_year => 2003, :end_year => 2005, :prefix => "date[first]", :use_separators => {:year => '年', :month => '月', :day => '日'})
|
161
|
+
end
|
162
|
+
|
163
|
+
def test_select_datetime
|
164
|
+
expected = %(<select id="date_first_year" name="date[first][year]">\n)
|
165
|
+
expected << %(<option value="2003" selected="selected">2003</option>\n<option value="2004">2004</option>\n<option value="2005">2005</option>\n)
|
166
|
+
expected << "</select>\n"
|
167
|
+
|
168
|
+
expected << %(<select id="date_first_month" name="date[first][month]">\n)
|
169
|
+
expected << %(<option value="1">January</option>\n<option value="2">February</option>\n<option value="3">March</option>\n<option value="4">April</option>\n<option value="5">May</option>\n<option value="6">June</option>\n<option value="7">July</option>\n<option value="8" selected="selected">August</option>\n<option value="9">September</option>\n<option value="10">October</option>\n<option value="11">November</option>\n<option value="12">December</option>\n)
|
170
|
+
expected << "</select>\n"
|
171
|
+
|
172
|
+
expected << %(<select id="date_first_day" name="date[first][day]">\n)
|
173
|
+
expected << %(<option value="1">1</option>\n<option value="2">2</option>\n<option value="3">3</option>\n<option value="4">4</option>\n<option value="5">5</option>\n<option value="6">6</option>\n<option value="7">7</option>\n<option value="8">8</option>\n<option value="9">9</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16" selected="selected">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n<option value="24">24</option>\n<option value="25">25</option>\n<option value="26">26</option>\n<option value="27">27</option>\n<option value="28">28</option>\n<option value="29">29</option>\n<option value="30">30</option>\n<option value="31">31</option>\n)
|
174
|
+
expected << "</select>\n"
|
175
|
+
|
176
|
+
expected << " — "
|
177
|
+
|
178
|
+
expected << %(<select id="date_first_hour" name="date[first][hour]">\n)
|
179
|
+
expected << %(<option value="00">00</option>\n<option value="01">01</option>\n<option value="02">02</option>\n<option value="03">03</option>\n<option value="04">04</option>\n<option value="05">05</option>\n<option value="06">06</option>\n<option value="07">07</option>\n<option value="08" selected="selected">08</option>\n<option value="09">09</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n)
|
180
|
+
expected << "</select>\n"
|
181
|
+
|
182
|
+
expected << " : "
|
183
|
+
|
184
|
+
expected << %(<select id="date_first_minute" name="date[first][minute]">\n)
|
185
|
+
expected << %(<option value="00">00</option>\n<option value="01">01</option>\n<option value="02">02</option>\n<option value="03">03</option>\n<option value="04" selected="selected">04</option>\n<option value="05">05</option>\n<option value="06">06</option>\n<option value="07">07</option>\n<option value="08">08</option>\n<option value="09">09</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n<option value="24">24</option>\n<option value="25">25</option>\n<option value="26">26</option>\n<option value="27">27</option>\n<option value="28">28</option>\n<option value="29">29</option>\n<option value="30">30</option>\n<option value="31">31</option>\n<option value="32">32</option>\n<option value="33">33</option>\n<option value="34">34</option>\n<option value="35">35</option>\n<option value="36">36</option>\n<option value="37">37</option>\n<option value="38">38</option>\n<option value="39">39</option>\n<option value="40">40</option>\n<option value="41">41</option>\n<option value="42">42</option>\n<option value="43">43</option>\n<option value="44">44</option>\n<option value="45">45</option>\n<option value="46">46</option>\n<option value="47">47</option>\n<option value="48">48</option>\n<option value="49">49</option>\n<option value="50">50</option>\n<option value="51">51</option>\n<option value="52">52</option>\n<option value="53">53</option>\n<option value="54">54</option>\n<option value="55">55</option>\n<option value="56">56</option>\n<option value="57">57</option>\n<option value="58">58</option>\n<option value="59">59</option>\n)
|
186
|
+
expected << "</select>\n"
|
187
|
+
|
188
|
+
assert_dom_equal expected, select_datetime(Time.mktime(2003, 8, 16, 8, 4, 18), :start_year => 2003, :end_year => 2005, :prefix => "date[first]")
|
189
|
+
end
|
190
|
+
|
191
|
+
def test_select_datetime_with_custom_separators
|
192
|
+
expected = %(<select id="date_first_year" name="date[first][year]">\n)
|
193
|
+
expected << %(<option value="2003" selected="selected">2003</option>\n<option value="2004">2004</option>\n<option value="2005">2005</option>\n)
|
194
|
+
expected << "</select>\n"
|
195
|
+
expected << %(<span class="separator_year">年</span>)
|
196
|
+
|
197
|
+
expected << %(<select id="date_first_month" name="date[first][month]">\n)
|
198
|
+
expected << %(<option value="1">January</option>\n<option value="2">February</option>\n<option value="3">March</option>\n<option value="4">April</option>\n<option value="5">May</option>\n<option value="6">June</option>\n<option value="7">July</option>\n<option value="8" selected="selected">August</option>\n<option value="9">September</option>\n<option value="10">October</option>\n<option value="11">November</option>\n<option value="12">December</option>\n)
|
199
|
+
expected << "</select>\n"
|
200
|
+
expected << %(<span class="separator_month">月</span>)
|
201
|
+
|
202
|
+
expected << %(<select id="date_first_day" name="date[first][day]">\n)
|
203
|
+
expected << %(<option value="1">1</option>\n<option value="2">2</option>\n<option value="3">3</option>\n<option value="4">4</option>\n<option value="5">5</option>\n<option value="6">6</option>\n<option value="7">7</option>\n<option value="8">8</option>\n<option value="9">9</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16" selected="selected">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n<option value="24">24</option>\n<option value="25">25</option>\n<option value="26">26</option>\n<option value="27">27</option>\n<option value="28">28</option>\n<option value="29">29</option>\n<option value="30">30</option>\n<option value="31">31</option>\n)
|
204
|
+
expected << "</select>\n"
|
205
|
+
expected << %(<span class="separator_day">日</span>)
|
206
|
+
|
207
|
+
expected << " — "
|
208
|
+
|
209
|
+
expected << %(<select id="date_first_hour" name="date[first][hour]">\n)
|
210
|
+
expected << %(<option value="00">00</option>\n<option value="01">01</option>\n<option value="02">02</option>\n<option value="03">03</option>\n<option value="04">04</option>\n<option value="05">05</option>\n<option value="06">06</option>\n<option value="07">07</option>\n<option value="08" selected="selected">08</option>\n<option value="09">09</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n)
|
211
|
+
expected << "</select>\n"
|
212
|
+
expected << %(<span class="separator_hour">時</span>)
|
213
|
+
|
214
|
+
expected << " : "
|
215
|
+
|
216
|
+
expected << %(<select id="date_first_minute" name="date[first][minute]">\n)
|
217
|
+
expected << %(<option value="00">00</option>\n<option value="01">01</option>\n<option value="02">02</option>\n<option value="03">03</option>\n<option value="04" selected="selected">04</option>\n<option value="05">05</option>\n<option value="06">06</option>\n<option value="07">07</option>\n<option value="08">08</option>\n<option value="09">09</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n<option value="24">24</option>\n<option value="25">25</option>\n<option value="26">26</option>\n<option value="27">27</option>\n<option value="28">28</option>\n<option value="29">29</option>\n<option value="30">30</option>\n<option value="31">31</option>\n<option value="32">32</option>\n<option value="33">33</option>\n<option value="34">34</option>\n<option value="35">35</option>\n<option value="36">36</option>\n<option value="37">37</option>\n<option value="38">38</option>\n<option value="39">39</option>\n<option value="40">40</option>\n<option value="41">41</option>\n<option value="42">42</option>\n<option value="43">43</option>\n<option value="44">44</option>\n<option value="45">45</option>\n<option value="46">46</option>\n<option value="47">47</option>\n<option value="48">48</option>\n<option value="49">49</option>\n<option value="50">50</option>\n<option value="51">51</option>\n<option value="52">52</option>\n<option value="53">53</option>\n<option value="54">54</option>\n<option value="55">55</option>\n<option value="56">56</option>\n<option value="57">57</option>\n<option value="58">58</option>\n<option value="59">59</option>\n)
|
218
|
+
expected << "</select>\n"
|
219
|
+
expected << %(<span class="separator_minute">分</span>)
|
220
|
+
|
221
|
+
assert_dom_equal expected, select_datetime(Time.mktime(2003, 8, 16, 8, 4, 18), :start_year => 2003, :end_year => 2005, :prefix => "date[first]", :use_separators => {:year => '年', :month => '月', :day => '日', :hour => '時', :minute => '分'})
|
222
|
+
end
|
223
|
+
|
224
|
+
def test_select_time
|
225
|
+
expected = %(<input name="date[year]" id="date_year" value="2003" type="hidden" />\n)
|
226
|
+
expected << %(<input name="date[month]" id="date_month" value="8" type="hidden" />\n)
|
227
|
+
expected << %(<input name="date[day]" id="date_day" value="16" type="hidden" />\n)
|
228
|
+
|
229
|
+
expected << %(<select id="date_hour" name="date[hour]">\n)
|
230
|
+
expected << %(<option value="00">00</option>\n<option value="01">01</option>\n<option value="02">02</option>\n<option value="03">03</option>\n<option value="04">04</option>\n<option value="05">05</option>\n<option value="06">06</option>\n<option value="07">07</option>\n<option value="08" selected="selected">08</option>\n<option value="09">09</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n)
|
231
|
+
expected << "</select>\n"
|
232
|
+
|
233
|
+
expected << " : "
|
234
|
+
|
235
|
+
expected << %(<select id="date_minute" name="date[minute]">\n)
|
236
|
+
expected << %(<option value="00">00</option>\n<option value="01">01</option>\n<option value="02">02</option>\n<option value="03">03</option>\n<option value="04" selected="selected">04</option>\n<option value="05">05</option>\n<option value="06">06</option>\n<option value="07">07</option>\n<option value="08">08</option>\n<option value="09">09</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n<option value="24">24</option>\n<option value="25">25</option>\n<option value="26">26</option>\n<option value="27">27</option>\n<option value="28">28</option>\n<option value="29">29</option>\n<option value="30">30</option>\n<option value="31">31</option>\n<option value="32">32</option>\n<option value="33">33</option>\n<option value="34">34</option>\n<option value="35">35</option>\n<option value="36">36</option>\n<option value="37">37</option>\n<option value="38">38</option>\n<option value="39">39</option>\n<option value="40">40</option>\n<option value="41">41</option>\n<option value="42">42</option>\n<option value="43">43</option>\n<option value="44">44</option>\n<option value="45">45</option>\n<option value="46">46</option>\n<option value="47">47</option>\n<option value="48">48</option>\n<option value="49">49</option>\n<option value="50">50</option>\n<option value="51">51</option>\n<option value="52">52</option>\n<option value="53">53</option>\n<option value="54">54</option>\n<option value="55">55</option>\n<option value="56">56</option>\n<option value="57">57</option>\n<option value="58">58</option>\n<option value="59">59</option>\n)
|
237
|
+
expected << "</select>\n"
|
238
|
+
|
239
|
+
assert_dom_equal expected, select_time(Time.mktime(2003, 8, 16, 8, 4, 18))
|
240
|
+
end
|
241
|
+
|
242
|
+
def test_select_time_with_custom_separators
|
243
|
+
expected = %(<input name="date[year]" id="date_year" value="2003" type="hidden" />\n)
|
244
|
+
expected << %(<input name="date[month]" id="date_month" value="8" type="hidden" />\n)
|
245
|
+
expected << %(<input name="date[day]" id="date_day" value="16" type="hidden" />\n)
|
246
|
+
|
247
|
+
expected << %(<select id="date_hour" name="date[hour]">\n)
|
248
|
+
expected << %(<option value="00">00</option>\n<option value="01">01</option>\n<option value="02">02</option>\n<option value="03">03</option>\n<option value="04">04</option>\n<option value="05">05</option>\n<option value="06">06</option>\n<option value="07">07</option>\n<option value="08" selected="selected">08</option>\n<option value="09">09</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n)
|
249
|
+
expected << "</select>\n"
|
250
|
+
expected << %(<span class="separator_hour">時</span>)
|
251
|
+
|
252
|
+
expected << " : "
|
253
|
+
|
254
|
+
expected << %(<select id="date_minute" name="date[minute]">\n)
|
255
|
+
expected << %(<option value="00">00</option>\n<option value="01">01</option>\n<option value="02">02</option>\n<option value="03">03</option>\n<option value="04" selected="selected">04</option>\n<option value="05">05</option>\n<option value="06">06</option>\n<option value="07">07</option>\n<option value="08">08</option>\n<option value="09">09</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n<option value="24">24</option>\n<option value="25">25</option>\n<option value="26">26</option>\n<option value="27">27</option>\n<option value="28">28</option>\n<option value="29">29</option>\n<option value="30">30</option>\n<option value="31">31</option>\n<option value="32">32</option>\n<option value="33">33</option>\n<option value="34">34</option>\n<option value="35">35</option>\n<option value="36">36</option>\n<option value="37">37</option>\n<option value="38">38</option>\n<option value="39">39</option>\n<option value="40">40</option>\n<option value="41">41</option>\n<option value="42">42</option>\n<option value="43">43</option>\n<option value="44">44</option>\n<option value="45">45</option>\n<option value="46">46</option>\n<option value="47">47</option>\n<option value="48">48</option>\n<option value="49">49</option>\n<option value="50">50</option>\n<option value="51">51</option>\n<option value="52">52</option>\n<option value="53">53</option>\n<option value="54">54</option>\n<option value="55">55</option>\n<option value="56">56</option>\n<option value="57">57</option>\n<option value="58">58</option>\n<option value="59">59</option>\n)
|
256
|
+
expected << "</select>\n"
|
257
|
+
expected << %(<span class="separator_minute">分</span>)
|
258
|
+
|
259
|
+
assert_dom_equal expected, select_time(Time.mktime(2003, 8, 16, 8, 4, 18), :use_separators => {:hour => '時', :minute => '分'})
|
260
|
+
end
|
261
|
+
|
262
|
+
def test_select_time_with_seconds
|
263
|
+
expected = %(<input name="date[year]" id="date_year" value="2003" type="hidden" />\n)
|
264
|
+
expected << %(<input name="date[month]" id="date_month" value="8" type="hidden" />\n)
|
265
|
+
expected << %(<input name="date[day]" id="date_day" value="16" type="hidden" />\n)
|
266
|
+
|
267
|
+
expected << %(<select id="date_hour" name="date[hour]">\n)
|
268
|
+
expected << %(<option value="00">00</option>\n<option value="01">01</option>\n<option value="02">02</option>\n<option value="03">03</option>\n<option value="04">04</option>\n<option value="05">05</option>\n<option value="06">06</option>\n<option value="07">07</option>\n<option value="08" selected="selected">08</option>\n<option value="09">09</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n)
|
269
|
+
expected << "</select>\n"
|
270
|
+
|
271
|
+
expected << ' : '
|
272
|
+
|
273
|
+
expected << %(<select id="date_minute" name="date[minute]">\n)
|
274
|
+
expected << %(<option value="00">00</option>\n<option value="01">01</option>\n<option value="02">02</option>\n<option value="03">03</option>\n<option value="04" selected="selected">04</option>\n<option value="05">05</option>\n<option value="06">06</option>\n<option value="07">07</option>\n<option value="08">08</option>\n<option value="09">09</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n<option value="24">24</option>\n<option value="25">25</option>\n<option value="26">26</option>\n<option value="27">27</option>\n<option value="28">28</option>\n<option value="29">29</option>\n<option value="30">30</option>\n<option value="31">31</option>\n<option value="32">32</option>\n<option value="33">33</option>\n<option value="34">34</option>\n<option value="35">35</option>\n<option value="36">36</option>\n<option value="37">37</option>\n<option value="38">38</option>\n<option value="39">39</option>\n<option value="40">40</option>\n<option value="41">41</option>\n<option value="42">42</option>\n<option value="43">43</option>\n<option value="44">44</option>\n<option value="45">45</option>\n<option value="46">46</option>\n<option value="47">47</option>\n<option value="48">48</option>\n<option value="49">49</option>\n<option value="50">50</option>\n<option value="51">51</option>\n<option value="52">52</option>\n<option value="53">53</option>\n<option value="54">54</option>\n<option value="55">55</option>\n<option value="56">56</option>\n<option value="57">57</option>\n<option value="58">58</option>\n<option value="59">59</option>\n)
|
275
|
+
expected << "</select>\n"
|
276
|
+
|
277
|
+
expected << ' : '
|
278
|
+
|
279
|
+
expected << %(<select id="date_second" name="date[second]">\n)
|
280
|
+
expected << %(<option value="00">00</option>\n<option value="01">01</option>\n<option value="02">02</option>\n<option value="03">03</option>\n<option value="04">04</option>\n<option value="05">05</option>\n<option value="06">06</option>\n<option value="07">07</option>\n<option value="08">08</option>\n<option value="09">09</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16">16</option>\n<option value="17">17</option>\n<option value="18" selected="selected">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n<option value="24">24</option>\n<option value="25">25</option>\n<option value="26">26</option>\n<option value="27">27</option>\n<option value="28">28</option>\n<option value="29">29</option>\n<option value="30">30</option>\n<option value="31">31</option>\n<option value="32">32</option>\n<option value="33">33</option>\n<option value="34">34</option>\n<option value="35">35</option>\n<option value="36">36</option>\n<option value="37">37</option>\n<option value="38">38</option>\n<option value="39">39</option>\n<option value="40">40</option>\n<option value="41">41</option>\n<option value="42">42</option>\n<option value="43">43</option>\n<option value="44">44</option>\n<option value="45">45</option>\n<option value="46">46</option>\n<option value="47">47</option>\n<option value="48">48</option>\n<option value="49">49</option>\n<option value="50">50</option>\n<option value="51">51</option>\n<option value="52">52</option>\n<option value="53">53</option>\n<option value="54">54</option>\n<option value="55">55</option>\n<option value="56">56</option>\n<option value="57">57</option>\n<option value="58">58</option>\n<option value="59">59</option>\n)
|
281
|
+
expected << "</select>\n"
|
282
|
+
|
283
|
+
assert_dom_equal expected, select_time(Time.mktime(2003, 8, 16, 8, 4, 18), :include_seconds => true)
|
284
|
+
end
|
285
|
+
|
286
|
+
def test_select_time_with_seconds_and_custom_separators
|
287
|
+
expected = %(<input name="date[year]" id="date_year" value="2003" type="hidden" />\n)
|
288
|
+
expected << %(<input name="date[month]" id="date_month" value="8" type="hidden" />\n)
|
289
|
+
expected << %(<input name="date[day]" id="date_day" value="16" type="hidden" />\n)
|
290
|
+
|
291
|
+
expected << %(<select id="date_hour" name="date[hour]">\n)
|
292
|
+
expected << %(<option value="00">00</option>\n<option value="01">01</option>\n<option value="02">02</option>\n<option value="03">03</option>\n<option value="04">04</option>\n<option value="05">05</option>\n<option value="06">06</option>\n<option value="07">07</option>\n<option value="08" selected="selected">08</option>\n<option value="09">09</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n)
|
293
|
+
expected << "</select>\n"
|
294
|
+
expected << %(<span class="separator_hour">時</span>)
|
295
|
+
|
296
|
+
expected << ' : '
|
297
|
+
|
298
|
+
expected << %(<select id="date_minute" name="date[minute]">\n)
|
299
|
+
expected << %(<option value="00">00</option>\n<option value="01">01</option>\n<option value="02">02</option>\n<option value="03">03</option>\n<option value="04" selected="selected">04</option>\n<option value="05">05</option>\n<option value="06">06</option>\n<option value="07">07</option>\n<option value="08">08</option>\n<option value="09">09</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n<option value="24">24</option>\n<option value="25">25</option>\n<option value="26">26</option>\n<option value="27">27</option>\n<option value="28">28</option>\n<option value="29">29</option>\n<option value="30">30</option>\n<option value="31">31</option>\n<option value="32">32</option>\n<option value="33">33</option>\n<option value="34">34</option>\n<option value="35">35</option>\n<option value="36">36</option>\n<option value="37">37</option>\n<option value="38">38</option>\n<option value="39">39</option>\n<option value="40">40</option>\n<option value="41">41</option>\n<option value="42">42</option>\n<option value="43">43</option>\n<option value="44">44</option>\n<option value="45">45</option>\n<option value="46">46</option>\n<option value="47">47</option>\n<option value="48">48</option>\n<option value="49">49</option>\n<option value="50">50</option>\n<option value="51">51</option>\n<option value="52">52</option>\n<option value="53">53</option>\n<option value="54">54</option>\n<option value="55">55</option>\n<option value="56">56</option>\n<option value="57">57</option>\n<option value="58">58</option>\n<option value="59">59</option>\n)
|
300
|
+
expected << "</select>\n"
|
301
|
+
expected << %(<span class="separator_minute">分</span>)
|
302
|
+
|
303
|
+
expected << ' : '
|
304
|
+
|
305
|
+
expected << %(<select id="date_second" name="date[second]">\n)
|
306
|
+
expected << %(<option value="00">00</option>\n<option value="01">01</option>\n<option value="02">02</option>\n<option value="03">03</option>\n<option value="04">04</option>\n<option value="05">05</option>\n<option value="06">06</option>\n<option value="07">07</option>\n<option value="08">08</option>\n<option value="09">09</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16">16</option>\n<option value="17">17</option>\n<option value="18" selected="selected">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n<option value="24">24</option>\n<option value="25">25</option>\n<option value="26">26</option>\n<option value="27">27</option>\n<option value="28">28</option>\n<option value="29">29</option>\n<option value="30">30</option>\n<option value="31">31</option>\n<option value="32">32</option>\n<option value="33">33</option>\n<option value="34">34</option>\n<option value="35">35</option>\n<option value="36">36</option>\n<option value="37">37</option>\n<option value="38">38</option>\n<option value="39">39</option>\n<option value="40">40</option>\n<option value="41">41</option>\n<option value="42">42</option>\n<option value="43">43</option>\n<option value="44">44</option>\n<option value="45">45</option>\n<option value="46">46</option>\n<option value="47">47</option>\n<option value="48">48</option>\n<option value="49">49</option>\n<option value="50">50</option>\n<option value="51">51</option>\n<option value="52">52</option>\n<option value="53">53</option>\n<option value="54">54</option>\n<option value="55">55</option>\n<option value="56">56</option>\n<option value="57">57</option>\n<option value="58">58</option>\n<option value="59">59</option>\n)
|
307
|
+
expected << "</select>\n"
|
308
|
+
expected << %(<span class="separator_second">秒</span>)
|
309
|
+
|
310
|
+
assert_dom_equal expected, select_time(Time.mktime(2003, 8, 16, 8, 4, 18), :include_seconds => true, :use_separators => {:hour => '時', :minute => '分', :second => '秒'})
|
311
|
+
end
|
312
|
+
|
313
|
+
def test_time_select
|
314
|
+
@post = Post.new
|
315
|
+
@post.written_on = Time.local(2004, 6, 15, 15, 16, 35)
|
316
|
+
|
317
|
+
expected = %{<input type="hidden" id="post_written_on_1i" name="post[written_on(1i)]" value="2004" />\n}
|
318
|
+
expected << %{<input type="hidden" id="post_written_on_2i" name="post[written_on(2i)]" value="6" />\n}
|
319
|
+
expected << %{<input type="hidden" id="post_written_on_3i" name="post[written_on(3i)]" value="15" />\n}
|
320
|
+
|
321
|
+
expected << %(<select id="post_written_on_4i" name="post[written_on(4i)]">\n)
|
322
|
+
0.upto(23) { |i| expected << %(<option value="#{sprintf("%02d", i)}"#{' selected="selected"' if i == 15}>#{sprintf("%02d", i)}</option>\n) }
|
323
|
+
expected << "</select>\n"
|
324
|
+
expected << " : "
|
325
|
+
expected << %(<select id="post_written_on_5i" name="post[written_on(5i)]">\n)
|
326
|
+
0.upto(59) { |i| expected << %(<option value="#{sprintf("%02d", i)}"#{' selected="selected"' if i == 16}>#{sprintf("%02d", i)}</option>\n) }
|
327
|
+
expected << "</select>\n"
|
328
|
+
|
329
|
+
assert_dom_equal expected, time_select("post", "written_on")
|
330
|
+
end
|
331
|
+
|
332
|
+
def test_time_select_with_custom_separators
|
333
|
+
@post = Post.new
|
334
|
+
@post.written_on = Time.local(2004, 6, 15, 15, 16, 35)
|
335
|
+
|
336
|
+
expected = %{<input type="hidden" id="post_written_on_1i" name="post[written_on(1i)]" value="2004" />\n}
|
337
|
+
expected << %{<input type="hidden" id="post_written_on_2i" name="post[written_on(2i)]" value="6" />\n}
|
338
|
+
expected << %{<input type="hidden" id="post_written_on_3i" name="post[written_on(3i)]" value="15" />\n}
|
339
|
+
|
340
|
+
expected << %(<select id="post_written_on_4i" name="post[written_on(4i)]">\n)
|
341
|
+
0.upto(23) { |i| expected << %(<option value="#{sprintf("%02d", i)}"#{' selected="selected"' if i == 15}>#{sprintf("%02d", i)}</option>\n) }
|
342
|
+
expected << "</select>\n"
|
343
|
+
expected << %(<span class="separator_hour">時</span>)
|
344
|
+
expected << " : "
|
345
|
+
expected << %(<select id="post_written_on_5i" name="post[written_on(5i)]">\n)
|
346
|
+
0.upto(59) { |i| expected << %(<option value="#{sprintf("%02d", i)}"#{' selected="selected"' if i == 16}>#{sprintf("%02d", i)}</option>\n) }
|
347
|
+
expected << "</select>\n"
|
348
|
+
expected << %(<span class="separator_minute">分</span>)
|
349
|
+
|
350
|
+
assert_dom_equal expected, time_select("post", "written_on", :use_separators => {:hour => '時', :minute => '分'})
|
351
|
+
end
|
352
|
+
|
353
|
+
def test_time_select_with_seconds
|
354
|
+
@post = Post.new
|
355
|
+
@post.written_on = Time.local(2004, 6, 15, 15, 16, 35)
|
356
|
+
|
357
|
+
expected = %{<input type="hidden" id="post_written_on_1i" name="post[written_on(1i)]" value="2004" />\n}
|
358
|
+
expected << %{<input type="hidden" id="post_written_on_2i" name="post[written_on(2i)]" value="6" />\n}
|
359
|
+
expected << %{<input type="hidden" id="post_written_on_3i" name="post[written_on(3i)]" value="15" />\n}
|
360
|
+
|
361
|
+
expected << %(<select id="post_written_on_4i" name="post[written_on(4i)]">\n)
|
362
|
+
0.upto(23) { |i| expected << %(<option value="#{sprintf("%02d", i)}"#{' selected="selected"' if i == 15}>#{sprintf("%02d", i)}</option>\n) }
|
363
|
+
expected << "</select>\n"
|
364
|
+
expected << " : "
|
365
|
+
expected << %(<select id="post_written_on_5i" name="post[written_on(5i)]">\n)
|
366
|
+
0.upto(59) { |i| expected << %(<option value="#{sprintf("%02d", i)}"#{' selected="selected"' if i == 16}>#{sprintf("%02d", i)}</option>\n) }
|
367
|
+
expected << "</select>\n"
|
368
|
+
expected << " : "
|
369
|
+
expected << %(<select id="post_written_on_6i" name="post[written_on(6i)]">\n)
|
370
|
+
0.upto(59) { |i| expected << %(<option value="#{sprintf("%02d", i)}"#{' selected="selected"' if i == 35}>#{sprintf("%02d", i)}</option>\n) }
|
371
|
+
expected << "</select>\n"
|
372
|
+
|
373
|
+
assert_dom_equal expected, time_select("post", "written_on", :include_seconds => true)
|
374
|
+
end
|
375
|
+
|
376
|
+
def test_time_select_with_seconds_and_custom_separators
|
377
|
+
@post = Post.new
|
378
|
+
@post.written_on = Time.local(2004, 6, 15, 15, 16, 35)
|
379
|
+
|
380
|
+
expected = %{<input type="hidden" id="post_written_on_1i" name="post[written_on(1i)]" value="2004" />\n}
|
381
|
+
expected << %{<input type="hidden" id="post_written_on_2i" name="post[written_on(2i)]" value="6" />\n}
|
382
|
+
expected << %{<input type="hidden" id="post_written_on_3i" name="post[written_on(3i)]" value="15" />\n}
|
383
|
+
|
384
|
+
expected << %(<select id="post_written_on_4i" name="post[written_on(4i)]">\n)
|
385
|
+
0.upto(23) { |i| expected << %(<option value="#{sprintf("%02d", i)}"#{' selected="selected"' if i == 15}>#{sprintf("%02d", i)}</option>\n) }
|
386
|
+
expected << "</select>\n"
|
387
|
+
expected << %(<span class="separator_hour">時</span>)
|
388
|
+
expected << " : "
|
389
|
+
expected << %(<select id="post_written_on_5i" name="post[written_on(5i)]">\n)
|
390
|
+
0.upto(59) { |i| expected << %(<option value="#{sprintf("%02d", i)}"#{' selected="selected"' if i == 16}>#{sprintf("%02d", i)}</option>\n) }
|
391
|
+
expected << "</select>\n"
|
392
|
+
expected << %(<span class="separator_minute">分</span>)
|
393
|
+
expected << " : "
|
394
|
+
expected << %(<select id="post_written_on_6i" name="post[written_on(6i)]">\n)
|
395
|
+
0.upto(59) { |i| expected << %(<option value="#{sprintf("%02d", i)}"#{' selected="selected"' if i == 35}>#{sprintf("%02d", i)}</option>\n) }
|
396
|
+
expected << "</select>\n"
|
397
|
+
expected << %(<span class="separator_second">秒</span>)
|
398
|
+
|
399
|
+
assert_dom_equal expected, time_select("post", "written_on", :include_seconds => true, :use_separators => {:hour => '時', :minute => '分', :second => '秒'})
|
400
|
+
end
|
401
|
+
|
402
|
+
def test_datetime_select
|
403
|
+
@post = Post.new
|
404
|
+
@post.updated_at = Time.local(2004, 6, 15, 16, 35)
|
405
|
+
|
406
|
+
expected = %{<select id="post_updated_at_1i" name="post[updated_at(1i)]">\n}
|
407
|
+
expected << %{<option value="1999">1999</option>\n<option value="2000">2000</option>\n<option value="2001">2001</option>\n<option value="2002">2002</option>\n<option value="2003">2003</option>\n<option value="2004" selected="selected">2004</option>\n<option value="2005">2005</option>\n<option value="2006">2006</option>\n<option value="2007">2007</option>\n<option value="2008">2008</option>\n<option value="2009">2009</option>\n}
|
408
|
+
expected << "</select>\n"
|
409
|
+
|
410
|
+
expected << %{<select id="post_updated_at_2i" name="post[updated_at(2i)]">\n}
|
411
|
+
expected << %{<option value="1">January</option>\n<option value="2">February</option>\n<option value="3">March</option>\n<option value="4">April</option>\n<option value="5">May</option>\n<option value="6" selected="selected">June</option>\n<option value="7">July</option>\n<option value="8">August</option>\n<option value="9">September</option>\n<option value="10">October</option>\n<option value="11">November</option>\n<option value="12">December</option>\n}
|
412
|
+
expected << "</select>\n"
|
413
|
+
|
414
|
+
expected << %{<select id="post_updated_at_3i" name="post[updated_at(3i)]">\n}
|
415
|
+
expected << %{<option value="1">1</option>\n<option value="2">2</option>\n<option value="3">3</option>\n<option value="4">4</option>\n<option value="5">5</option>\n<option value="6">6</option>\n<option value="7">7</option>\n<option value="8">8</option>\n<option value="9">9</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15" selected="selected">15</option>\n<option value="16">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n<option value="24">24</option>\n<option value="25">25</option>\n<option value="26">26</option>\n<option value="27">27</option>\n<option value="28">28</option>\n<option value="29">29</option>\n<option value="30">30</option>\n<option value="31">31</option>\n}
|
416
|
+
expected << "</select>\n"
|
417
|
+
|
418
|
+
expected << " — "
|
419
|
+
|
420
|
+
expected << %{<select id="post_updated_at_4i" name="post[updated_at(4i)]">\n}
|
421
|
+
expected << %{<option value="00">00</option>\n<option value="01">01</option>\n<option value="02">02</option>\n<option value="03">03</option>\n<option value="04">04</option>\n<option value="05">05</option>\n<option value="06">06</option>\n<option value="07">07</option>\n<option value="08">08</option>\n<option value="09">09</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16" selected="selected">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n}
|
422
|
+
expected << "</select>\n"
|
423
|
+
expected << " : "
|
424
|
+
expected << %{<select id="post_updated_at_5i" name="post[updated_at(5i)]">\n}
|
425
|
+
expected << %{<option value="00">00</option>\n<option value="01">01</option>\n<option value="02">02</option>\n<option value="03">03</option>\n<option value="04">04</option>\n<option value="05">05</option>\n<option value="06">06</option>\n<option value="07">07</option>\n<option value="08">08</option>\n<option value="09">09</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n<option value="24">24</option>\n<option value="25">25</option>\n<option value="26">26</option>\n<option value="27">27</option>\n<option value="28">28</option>\n<option value="29">29</option>\n<option value="30">30</option>\n<option value="31">31</option>\n<option value="32">32</option>\n<option value="33">33</option>\n<option value="34">34</option>\n<option value="35" selected="selected">35</option>\n<option value="36">36</option>\n<option value="37">37</option>\n<option value="38">38</option>\n<option value="39">39</option>\n<option value="40">40</option>\n<option value="41">41</option>\n<option value="42">42</option>\n<option value="43">43</option>\n<option value="44">44</option>\n<option value="45">45</option>\n<option value="46">46</option>\n<option value="47">47</option>\n<option value="48">48</option>\n<option value="49">49</option>\n<option value="50">50</option>\n<option value="51">51</option>\n<option value="52">52</option>\n<option value="53">53</option>\n<option value="54">54</option>\n<option value="55">55</option>\n<option value="56">56</option>\n<option value="57">57</option>\n<option value="58">58</option>\n<option value="59">59</option>\n}
|
426
|
+
expected << "</select>\n"
|
427
|
+
|
428
|
+
assert_dom_equal expected, datetime_select("post", "updated_at")
|
429
|
+
end
|
430
|
+
|
431
|
+
def test_datetime_select_with_custom_separators
|
432
|
+
@post = Post.new
|
433
|
+
@post.updated_at = Time.local(2004, 6, 15, 16, 35)
|
434
|
+
|
435
|
+
expected = %{<select id="post_updated_at_1i" name="post[updated_at(1i)]">\n}
|
436
|
+
expected << %{<option value="1999">1999</option>\n<option value="2000">2000</option>\n<option value="2001">2001</option>\n<option value="2002">2002</option>\n<option value="2003">2003</option>\n<option value="2004" selected="selected">2004</option>\n<option value="2005">2005</option>\n<option value="2006">2006</option>\n<option value="2007">2007</option>\n<option value="2008">2008</option>\n<option value="2009">2009</option>\n}
|
437
|
+
expected << "</select>\n"
|
438
|
+
expected << %(<span class="separator_year">年</span>)
|
439
|
+
|
440
|
+
expected << %{<select id="post_updated_at_2i" name="post[updated_at(2i)]">\n}
|
441
|
+
expected << %{<option value="1">January</option>\n<option value="2">February</option>\n<option value="3">March</option>\n<option value="4">April</option>\n<option value="5">May</option>\n<option value="6" selected="selected">June</option>\n<option value="7">July</option>\n<option value="8">August</option>\n<option value="9">September</option>\n<option value="10">October</option>\n<option value="11">November</option>\n<option value="12">December</option>\n}
|
442
|
+
expected << "</select>\n"
|
443
|
+
expected << %(<span class="separator_month">月</span>)
|
444
|
+
|
445
|
+
expected << %{<select id="post_updated_at_3i" name="post[updated_at(3i)]">\n}
|
446
|
+
expected << %{<option value="1">1</option>\n<option value="2">2</option>\n<option value="3">3</option>\n<option value="4">4</option>\n<option value="5">5</option>\n<option value="6">6</option>\n<option value="7">7</option>\n<option value="8">8</option>\n<option value="9">9</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15" selected="selected">15</option>\n<option value="16">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n<option value="24">24</option>\n<option value="25">25</option>\n<option value="26">26</option>\n<option value="27">27</option>\n<option value="28">28</option>\n<option value="29">29</option>\n<option value="30">30</option>\n<option value="31">31</option>\n}
|
447
|
+
expected << "</select>\n"
|
448
|
+
expected << %(<span class="separator_day">日</span>)
|
449
|
+
|
450
|
+
expected << " — "
|
451
|
+
|
452
|
+
expected << %{<select id="post_updated_at_4i" name="post[updated_at(4i)]">\n}
|
453
|
+
expected << %{<option value="00">00</option>\n<option value="01">01</option>\n<option value="02">02</option>\n<option value="03">03</option>\n<option value="04">04</option>\n<option value="05">05</option>\n<option value="06">06</option>\n<option value="07">07</option>\n<option value="08">08</option>\n<option value="09">09</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16" selected="selected">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n}
|
454
|
+
expected << "</select>\n"
|
455
|
+
expected << %(<span class="separator_hour">時</span>)
|
456
|
+
expected << " : "
|
457
|
+
expected << %{<select id="post_updated_at_5i" name="post[updated_at(5i)]">\n}
|
458
|
+
expected << %{<option value="00">00</option>\n<option value="01">01</option>\n<option value="02">02</option>\n<option value="03">03</option>\n<option value="04">04</option>\n<option value="05">05</option>\n<option value="06">06</option>\n<option value="07">07</option>\n<option value="08">08</option>\n<option value="09">09</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n<option value="24">24</option>\n<option value="25">25</option>\n<option value="26">26</option>\n<option value="27">27</option>\n<option value="28">28</option>\n<option value="29">29</option>\n<option value="30">30</option>\n<option value="31">31</option>\n<option value="32">32</option>\n<option value="33">33</option>\n<option value="34">34</option>\n<option value="35" selected="selected">35</option>\n<option value="36">36</option>\n<option value="37">37</option>\n<option value="38">38</option>\n<option value="39">39</option>\n<option value="40">40</option>\n<option value="41">41</option>\n<option value="42">42</option>\n<option value="43">43</option>\n<option value="44">44</option>\n<option value="45">45</option>\n<option value="46">46</option>\n<option value="47">47</option>\n<option value="48">48</option>\n<option value="49">49</option>\n<option value="50">50</option>\n<option value="51">51</option>\n<option value="52">52</option>\n<option value="53">53</option>\n<option value="54">54</option>\n<option value="55">55</option>\n<option value="56">56</option>\n<option value="57">57</option>\n<option value="58">58</option>\n<option value="59">59</option>\n}
|
459
|
+
expected << "</select>\n"
|
460
|
+
expected << %(<span class="separator_minute">分</span>)
|
461
|
+
|
462
|
+
assert_dom_equal expected, datetime_select("post", "updated_at", :use_separators => {:year => '年', :month => '月', :day => '日', :hour => '時', :minute => '分'})
|
463
|
+
end
|
464
|
+
|
465
|
+
def test_datetime_select_with_custom_separators_and_html_tag
|
466
|
+
@post = Post.new
|
467
|
+
@post.updated_at = Time.local(2004, 6, 15, 16, 35)
|
468
|
+
|
469
|
+
expected = %{<select id="post_updated_at_1i" name="post[updated_at(1i)]">\n}
|
470
|
+
expected << %{<option value="1999">1999</option>\n<option value="2000">2000</option>\n<option value="2001">2001</option>\n<option value="2002">2002</option>\n<option value="2003">2003</option>\n<option value="2004" selected="selected">2004</option>\n<option value="2005">2005</option>\n<option value="2006">2006</option>\n<option value="2007">2007</option>\n<option value="2008">2008</option>\n<option value="2009">2009</option>\n}
|
471
|
+
expected << "</select>\n"
|
472
|
+
expected << %(<div class="separator_year">年</div>)
|
473
|
+
|
474
|
+
expected << %{<select id="post_updated_at_2i" name="post[updated_at(2i)]">\n}
|
475
|
+
expected << %{<option value="1">January</option>\n<option value="2">February</option>\n<option value="3">March</option>\n<option value="4">April</option>\n<option value="5">May</option>\n<option value="6" selected="selected">June</option>\n<option value="7">July</option>\n<option value="8">August</option>\n<option value="9">September</option>\n<option value="10">October</option>\n<option value="11">November</option>\n<option value="12">December</option>\n}
|
476
|
+
expected << "</select>\n"
|
477
|
+
expected << %(<div class="separator_month">月</div>)
|
478
|
+
|
479
|
+
expected << %{<select id="post_updated_at_3i" name="post[updated_at(3i)]">\n}
|
480
|
+
expected << %{<option value="1">1</option>\n<option value="2">2</option>\n<option value="3">3</option>\n<option value="4">4</option>\n<option value="5">5</option>\n<option value="6">6</option>\n<option value="7">7</option>\n<option value="8">8</option>\n<option value="9">9</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15" selected="selected">15</option>\n<option value="16">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n<option value="24">24</option>\n<option value="25">25</option>\n<option value="26">26</option>\n<option value="27">27</option>\n<option value="28">28</option>\n<option value="29">29</option>\n<option value="30">30</option>\n<option value="31">31</option>\n}
|
481
|
+
expected << "</select>\n"
|
482
|
+
expected << %(<div class="separator_day">日</div>)
|
483
|
+
|
484
|
+
expected << " — "
|
485
|
+
|
486
|
+
expected << %{<select id="post_updated_at_4i" name="post[updated_at(4i)]">\n}
|
487
|
+
expected << %{<option value="00">00</option>\n<option value="01">01</option>\n<option value="02">02</option>\n<option value="03">03</option>\n<option value="04">04</option>\n<option value="05">05</option>\n<option value="06">06</option>\n<option value="07">07</option>\n<option value="08">08</option>\n<option value="09">09</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16" selected="selected">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n}
|
488
|
+
expected << "</select>\n"
|
489
|
+
expected << %(<div class="separator_hour">時</div>)
|
490
|
+
expected << " : "
|
491
|
+
expected << %{<select id="post_updated_at_5i" name="post[updated_at(5i)]">\n}
|
492
|
+
expected << %{<option value="00">00</option>\n<option value="01">01</option>\n<option value="02">02</option>\n<option value="03">03</option>\n<option value="04">04</option>\n<option value="05">05</option>\n<option value="06">06</option>\n<option value="07">07</option>\n<option value="08">08</option>\n<option value="09">09</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n<option value="24">24</option>\n<option value="25">25</option>\n<option value="26">26</option>\n<option value="27">27</option>\n<option value="28">28</option>\n<option value="29">29</option>\n<option value="30">30</option>\n<option value="31">31</option>\n<option value="32">32</option>\n<option value="33">33</option>\n<option value="34">34</option>\n<option value="35" selected="selected">35</option>\n<option value="36">36</option>\n<option value="37">37</option>\n<option value="38">38</option>\n<option value="39">39</option>\n<option value="40">40</option>\n<option value="41">41</option>\n<option value="42">42</option>\n<option value="43">43</option>\n<option value="44">44</option>\n<option value="45">45</option>\n<option value="46">46</option>\n<option value="47">47</option>\n<option value="48">48</option>\n<option value="49">49</option>\n<option value="50">50</option>\n<option value="51">51</option>\n<option value="52">52</option>\n<option value="53">53</option>\n<option value="54">54</option>\n<option value="55">55</option>\n<option value="56">56</option>\n<option value="57">57</option>\n<option value="58">58</option>\n<option value="59">59</option>\n}
|
493
|
+
expected << "</select>\n"
|
494
|
+
expected << %(<div class="separator_minute">分</div>)
|
495
|
+
|
496
|
+
assert_dom_equal expected, datetime_select("post", "updated_at", :use_separators => {:year => '年', :month => '月', :day => '日', :hour => '時', :minute => '分', :html_tag => :div})
|
497
|
+
end
|
498
|
+
|
499
|
+
def test_datetime_select_with_custom_separators_and_class_prefix
|
500
|
+
@post = Post.new
|
501
|
+
@post.updated_at = Time.local(2004, 6, 15, 16, 35)
|
502
|
+
|
503
|
+
expected = %{<select id="post_updated_at_1i" name="post[updated_at(1i)]">\n}
|
504
|
+
expected << %{<option value="1999">1999</option>\n<option value="2000">2000</option>\n<option value="2001">2001</option>\n<option value="2002">2002</option>\n<option value="2003">2003</option>\n<option value="2004" selected="selected">2004</option>\n<option value="2005">2005</option>\n<option value="2006">2006</option>\n<option value="2007">2007</option>\n<option value="2008">2008</option>\n<option value="2009">2009</option>\n}
|
505
|
+
expected << "</select>\n"
|
506
|
+
expected << %(<span class="prefix_year">年</span>)
|
507
|
+
|
508
|
+
expected << %{<select id="post_updated_at_2i" name="post[updated_at(2i)]">\n}
|
509
|
+
expected << %{<option value="1">January</option>\n<option value="2">February</option>\n<option value="3">March</option>\n<option value="4">April</option>\n<option value="5">May</option>\n<option value="6" selected="selected">June</option>\n<option value="7">July</option>\n<option value="8">August</option>\n<option value="9">September</option>\n<option value="10">October</option>\n<option value="11">November</option>\n<option value="12">December</option>\n}
|
510
|
+
expected << "</select>\n"
|
511
|
+
expected << %(<span class="prefix_month">月</span>)
|
512
|
+
|
513
|
+
expected << %{<select id="post_updated_at_3i" name="post[updated_at(3i)]">\n}
|
514
|
+
expected << %{<option value="1">1</option>\n<option value="2">2</option>\n<option value="3">3</option>\n<option value="4">4</option>\n<option value="5">5</option>\n<option value="6">6</option>\n<option value="7">7</option>\n<option value="8">8</option>\n<option value="9">9</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15" selected="selected">15</option>\n<option value="16">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n<option value="24">24</option>\n<option value="25">25</option>\n<option value="26">26</option>\n<option value="27">27</option>\n<option value="28">28</option>\n<option value="29">29</option>\n<option value="30">30</option>\n<option value="31">31</option>\n}
|
515
|
+
expected << "</select>\n"
|
516
|
+
expected << %(<span class="prefix_day">日</span>)
|
517
|
+
|
518
|
+
expected << " — "
|
519
|
+
|
520
|
+
expected << %{<select id="post_updated_at_4i" name="post[updated_at(4i)]">\n}
|
521
|
+
expected << %{<option value="00">00</option>\n<option value="01">01</option>\n<option value="02">02</option>\n<option value="03">03</option>\n<option value="04">04</option>\n<option value="05">05</option>\n<option value="06">06</option>\n<option value="07">07</option>\n<option value="08">08</option>\n<option value="09">09</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16" selected="selected">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n}
|
522
|
+
expected << "</select>\n"
|
523
|
+
expected << %(<span class="prefix_hour">時</span>)
|
524
|
+
expected << " : "
|
525
|
+
expected << %{<select id="post_updated_at_5i" name="post[updated_at(5i)]">\n}
|
526
|
+
expected << %{<option value="00">00</option>\n<option value="01">01</option>\n<option value="02">02</option>\n<option value="03">03</option>\n<option value="04">04</option>\n<option value="05">05</option>\n<option value="06">06</option>\n<option value="07">07</option>\n<option value="08">08</option>\n<option value="09">09</option>\n<option value="10">10</option>\n<option value="11">11</option>\n<option value="12">12</option>\n<option value="13">13</option>\n<option value="14">14</option>\n<option value="15">15</option>\n<option value="16">16</option>\n<option value="17">17</option>\n<option value="18">18</option>\n<option value="19">19</option>\n<option value="20">20</option>\n<option value="21">21</option>\n<option value="22">22</option>\n<option value="23">23</option>\n<option value="24">24</option>\n<option value="25">25</option>\n<option value="26">26</option>\n<option value="27">27</option>\n<option value="28">28</option>\n<option value="29">29</option>\n<option value="30">30</option>\n<option value="31">31</option>\n<option value="32">32</option>\n<option value="33">33</option>\n<option value="34">34</option>\n<option value="35" selected="selected">35</option>\n<option value="36">36</option>\n<option value="37">37</option>\n<option value="38">38</option>\n<option value="39">39</option>\n<option value="40">40</option>\n<option value="41">41</option>\n<option value="42">42</option>\n<option value="43">43</option>\n<option value="44">44</option>\n<option value="45">45</option>\n<option value="46">46</option>\n<option value="47">47</option>\n<option value="48">48</option>\n<option value="49">49</option>\n<option value="50">50</option>\n<option value="51">51</option>\n<option value="52">52</option>\n<option value="53">53</option>\n<option value="54">54</option>\n<option value="55">55</option>\n<option value="56">56</option>\n<option value="57">57</option>\n<option value="58">58</option>\n<option value="59">59</option>\n}
|
527
|
+
expected << "</select>\n"
|
528
|
+
expected << %(<span class="prefix_minute">分</span>)
|
529
|
+
|
530
|
+
assert_dom_equal expected, datetime_select("post", "updated_at", :use_separators => {:year => '年', :month => '月', :day => '日', :hour => '時', :minute => '分', :class_prefix => 'prefix'})
|
531
|
+
end
|
532
|
+
|
533
|
+
def test_datetime_select_with_inline_custom_separators_except_month
|
534
|
+
@post = Post.new
|
535
|
+
@post.updated_at = Time.local(2004, 6, 15, 16, 35)
|
536
|
+
|
537
|
+
expected = %{<select id="post_updated_at_1i" name="post[updated_at(1i)]">\n}
|
538
|
+
expected << %{<option value="1999">1999年</option>\n<option value="2000">2000年</option>\n<option value="2001">2001年</option>\n<option value="2002">2002年</option>\n<option value="2003">2003年</option>\n<option value="2004" selected="selected">2004年</option>\n<option value="2005">2005年</option>\n<option value="2006">2006年</option>\n<option value="2007">2007年</option>\n<option value="2008">2008年</option>\n<option value="2009">2009年</option>\n}
|
539
|
+
expected << "</select>\n"
|
540
|
+
|
541
|
+
expected << %{<select id="post_updated_at_2i" name="post[updated_at(2i)]">\n}
|
542
|
+
expected << %{<option value="1">January</option>\n<option value="2">February</option>\n<option value="3">March</option>\n<option value="4">April</option>\n<option value="5">May</option>\n<option value="6" selected="selected">June</option>\n<option value="7">July</option>\n<option value="8">August</option>\n<option value="9">September</option>\n<option value="10">October</option>\n<option value="11">November</option>\n<option value="12">December</option>\n}
|
543
|
+
expected << "</select>\n"
|
544
|
+
|
545
|
+
expected << %{<select id="post_updated_at_3i" name="post[updated_at(3i)]">\n}
|
546
|
+
expected << %{<option value="1">1日</option>\n<option value="2">2日</option>\n<option value="3">3日</option>\n<option value="4">4日</option>\n<option value="5">5日</option>\n<option value="6">6日</option>\n<option value="7">7日</option>\n<option value="8">8日</option>\n<option value="9">9日</option>\n<option value="10">10日</option>\n<option value="11">11日</option>\n<option value="12">12日</option>\n<option value="13">13日</option>\n<option value="14">14日</option>\n<option value="15" selected="selected">15日</option>\n<option value="16">16日</option>\n<option value="17">17日</option>\n<option value="18">18日</option>\n<option value="19">19日</option>\n<option value="20">20日</option>\n<option value="21">21日</option>\n<option value="22">22日</option>\n<option value="23">23日</option>\n<option value="24">24日</option>\n<option value="25">25日</option>\n<option value="26">26日</option>\n<option value="27">27日</option>\n<option value="28">28日</option>\n<option value="29">29日</option>\n<option value="30">30日</option>\n<option value="31">31日</option>\n}
|
547
|
+
expected << "</select>\n"
|
548
|
+
|
549
|
+
expected << " — "
|
550
|
+
|
551
|
+
expected << %{<select id="post_updated_at_4i" name="post[updated_at(4i)]">\n}
|
552
|
+
expected << %{<option value="00">00時</option>\n<option value="01">01時</option>\n<option value="02">02時</option>\n<option value="03">03時</option>\n<option value="04">04時</option>\n<option value="05">05時</option>\n<option value="06">06時</option>\n<option value="07">07時</option>\n<option value="08">08時</option>\n<option value="09">09時</option>\n<option value="10">10時</option>\n<option value="11">11時</option>\n<option value="12">12時</option>\n<option value="13">13時</option>\n<option value="14">14時</option>\n<option value="15">15時</option>\n<option value="16" selected="selected">16時</option>\n<option value="17">17時</option>\n<option value="18">18時</option>\n<option value="19">19時</option>\n<option value="20">20時</option>\n<option value="21">21時</option>\n<option value="22">22時</option>\n<option value="23">23時</option>\n}
|
553
|
+
expected << "</select>\n"
|
554
|
+
expected << " : "
|
555
|
+
expected << %{<select id="post_updated_at_5i" name="post[updated_at(5i)]">\n}
|
556
|
+
expected << %{<option value="00">00分</option>\n<option value="01">01分</option>\n<option value="02">02分</option>\n<option value="03">03分</option>\n<option value="04">04分</option>\n<option value="05">05分</option>\n<option value="06">06分</option>\n<option value="07">07分</option>\n<option value="08">08分</option>\n<option value="09">09分</option>\n<option value="10">10分</option>\n<option value="11">11分</option>\n<option value="12">12分</option>\n<option value="13">13分</option>\n<option value="14">14分</option>\n<option value="15">15分</option>\n<option value="16">16分</option>\n<option value="17">17分</option>\n<option value="18">18分</option>\n<option value="19">19分</option>\n<option value="20">20分</option>\n<option value="21">21分</option>\n<option value="22">22分</option>\n<option value="23">23分</option>\n<option value="24">24分</option>\n<option value="25">25分</option>\n<option value="26">26分</option>\n<option value="27">27分</option>\n<option value="28">28分</option>\n<option value="29">29分</option>\n<option value="30">30分</option>\n<option value="31">31分</option>\n<option value="32">32分</option>\n<option value="33">33分</option>\n<option value="34">34分</option>\n<option value="35" selected="selected">35分</option>\n<option value="36">36分</option>\n<option value="37">37分</option>\n<option value="38">38分</option>\n<option value="39">39分</option>\n<option value="40">40分</option>\n<option value="41">41分</option>\n<option value="42">42分</option>\n<option value="43">43分</option>\n<option value="44">44分</option>\n<option value="45">45分</option>\n<option value="46">46分</option>\n<option value="47">47分</option>\n<option value="48">48分</option>\n<option value="49">49分</option>\n<option value="50">50分</option>\n<option value="51">51分</option>\n<option value="52">52分</option>\n<option value="53">53分</option>\n<option value="54">54分</option>\n<option value="55">55分</option>\n<option value="56">56分</option>\n<option value="57">57分</option>\n<option value="58">58分</option>\n<option value="59">59分</option>\n}
|
557
|
+
expected << "</select>\n"
|
558
|
+
|
559
|
+
assert_dom_equal expected, datetime_select("post", "updated_at", :use_separators => {:inline => true, :year => '年', :day => '日', :hour => '時', :minute => '分'})
|
560
|
+
end
|
561
|
+
end
|
metadata
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: date_select_separator
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- rono23
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-03-04 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rails
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 3.2.12
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 3.2.12
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: test-unit
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
description: Add separators to data_select on Rails
|
47
|
+
email:
|
48
|
+
- rono23@gmail.com
|
49
|
+
executables: []
|
50
|
+
extensions: []
|
51
|
+
extra_rdoc_files: []
|
52
|
+
files:
|
53
|
+
- .gitignore
|
54
|
+
- Gemfile
|
55
|
+
- LICENSE.txt
|
56
|
+
- README.md
|
57
|
+
- Rakefile
|
58
|
+
- date_select_separator.gemspec
|
59
|
+
- lib/date_select_separator.rb
|
60
|
+
- lib/date_select_separator/version.rb
|
61
|
+
- test/date_select_separator_test.rb
|
62
|
+
homepage: https://github.com/rono23/date_select_separator
|
63
|
+
licenses:
|
64
|
+
- MIT
|
65
|
+
post_install_message:
|
66
|
+
rdoc_options: []
|
67
|
+
require_paths:
|
68
|
+
- lib
|
69
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
70
|
+
none: false
|
71
|
+
requirements:
|
72
|
+
- - ! '>='
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
|
+
none: false
|
77
|
+
requirements:
|
78
|
+
- - ! '>='
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '0'
|
81
|
+
requirements: []
|
82
|
+
rubyforge_project:
|
83
|
+
rubygems_version: 1.8.23
|
84
|
+
signing_key:
|
85
|
+
specification_version: 3
|
86
|
+
summary: Add separators to data_select on Rails
|
87
|
+
test_files:
|
88
|
+
- test/date_select_separator_test.rb
|
89
|
+
has_rdoc:
|