Phoenix date_select フォーマット

2018年5月21日 Posted by PURGE

  <div class="form-group">
    <%= label f, :birthday, class: "control-label" %>
        <%= date_select f, :birthday, default: :calendar.local_time(), builder: fn b -> %>
          <%= b.(:month, [
                  options: [
                    {gettext("1月"), "1"},
                    {gettext("2月"), "2"},
                    {gettext("3月"), "3"},
                    {gettext("4月"), "4"},
                    {gettext("5月"), "5"},
                    {gettext("6月"), "6"},
                    {gettext("7月"), "7"},
                    {gettext("8月"), "8"},
                    {gettext("9月"), "9"},
                    {gettext("10月"), "10"},
                    {gettext("11月"), "11"},
                    {gettext("12月"), "12"},
                  ]
                ]) %>
        <% end %>
    <%= error_tag f, :birthday %>
  </div>

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です