aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/CHANGELOG.md
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-06-21 17:00:45 +0900
committerRyuta Kamizono <kamipo@gmail.com>2018-06-21 17:01:35 +0900
commit8f6c85f0364b099b7be36f430198ea9bdb648ab5 (patch)
treed94883d4bdfd32d5b07e4bc5899005fef289c6b1 /actionview/CHANGELOG.md
parentf84a4fd1d59761e3d0308ea17dcd2332440f648e (diff)
parent8f46a23d378cd807ff6c4a3b8e35723d4ef81432 (diff)
downloadrails-8f6c85f0364b099b7be36f430198ea9bdb648ab5.tar.gz
rails-8f6c85f0364b099b7be36f430198ea9bdb648ab5.tar.bz2
rails-8f6c85f0364b099b7be36f430198ea9bdb648ab5.zip
Merge pull request #32190 from liwii/use_year_names
Add `use_year_names` option to date_select tag
Diffstat (limited to 'actionview/CHANGELOG.md')
-rw-r--r--actionview/CHANGELOG.md18
1 files changed, 18 insertions, 0 deletions
diff --git a/actionview/CHANGELOG.md b/actionview/CHANGELOG.md
index 2c1ca12043..26170dfa77 100644
--- a/actionview/CHANGELOG.md
+++ b/actionview/CHANGELOG.md
@@ -1,3 +1,21 @@
+* Add `year_format` option to date_select tag. This option makes it possible to customize year
+ names. Lambda should be passed to use this option.
+
+ Example:
+
+ date_select('user_birthday', '', start_year: 1998, end_year: 2000, year_format: ->year { "Heisei #{year - 1988}" })
+
+ The HTML produced:
+
+ <select id="user_birthday__1i" name="user_birthday[(1i)]">
+ <option value="1998">Heisei 10</option>
+ <option value="1999">Heisei 11</option>
+ <option value="2000">Heisei 12</option>
+ </select>
+ /* The rest is omitted */
+
+ *Koki Ryu*
+
* Fix JavaScript views rendering does not work with Firefox when using
Content Security Policy.