Japanese version of the Rails Date Picker v0.31.
Original Rails Date Picker was written by David Lee (david [at] davelee [dot] com [dot] au), and the project homepage is http://projects.exactlyoneturtle.com/date_picker/ . Japanese Modification was done by Masatoshi Itagaki(masatoshi [at] rails [dot] to). License: use, modify and distribute freely as long as this header remains intact; please mail any improvements to the authors Changes: change the order of links(year before month). change month names to corresponding numbers. change days of the week to Japanese abbreviation. delete the function, formatDay and references. add a parameter showSuffixesInLink to select the link format. add a parameter showDayOfWeek to choose whether the day of the week appended after the link. modify date_picker_helper.rb and add parameters to date_picker_helper to pass them through.
\datepickerj.zip\
このrails helperは、David Leeさんが http://projects.exactlyoneturtle.com/date_picker/ で公開しているRails Date Picker v0.31を日本語化したものです。
========== ライセンス ==========
このソフトウェアは、David Leeさんのライセンスと同条件で公開されます。
原文(date-picker.jsソースより引用)/* ANSI Datepicker Calendar - David Lee 2005 david [at] davelee [dot] com [dot] au project homepage: http://projects.exactlyoneturtle.com/date_picker/ License: use, modify and distribute freely as long as this header remains intact; please mail any improvements to the author */ /* ANSI Datepicker Calender - Japanese Modification - Masatoshi Itagaki 2006 masatoshi [at] rails [dot] to distribution page: http://rails.to/pages/datepickerj/ ライセンス: このヘッダがそのまま添付されることを条件に、自由に使用、変更、配布ができ ます。改良を行った場合には、著者(David Lee氏および板垣)にメールしてくだ さい。 バグの報告は板垣までお願いします。 */
============ インストール ============
各ファイルを、Railsプロジェクトの該当するディレクトリにコピーしてください。
| date-picker.js | public/javascripts |
| date-picker.css | public/stylesheets |
| date_picker_helper.rb | app/helpers |
==== 設定 ====
(1)文字コードの設定
アプリケーションでUTF-8を使用するように設定を行います。
a)$KCODEの指定 config/environment.rbファイルの先頭に次の行を追加します。
|
|
(2)設定パラメータの指定
date-picker.jsのなかの、DatePickerの動作を決定するパラメータは次のとおりで す。それぞれの値は既定値を示します。// 高さを一定に保つか否か:falseに設定すると、カレンダの最後の行が空の場合 // 削除します。 constantHeight: true, // 年の選択にSelectリストを使用するか否か: useDropForYear: false, // 月の選択にSelectリストを使用するか否か: useDropForMonth: false, // 年のSelectリストで、現在からどれくらい前の年号を表示するか yearsPriorInDrop: 10, // 年のSelectリストで、現在からどれくらい後の年号を表示するか yearsNextInDrop: 10, // 現在の年 year: new Date().getFullYear(), // 週の初めの曜日 (0=日, 1=月, ...) firstDayOfWeek: 0, // リンク中で年の下2桁のみを表示します abbreviateYearInLink: false, // 月のSelectリストが使用される場合、インラインで書かれるサイズ(ピクセル) largeCellSize: 22, // これを設定した場合、日付を選択すると指定されたURLに送信されます。 // 例:'指定されたURL?date=' urlBase: null, // 選択を元に戻すキャンセルボタンを表示するか否か showCancelLink: true, // リンク中に年、月、日の文字を表示するか否か:trueの場合、%Y年%m月%d日で、 // falseの場合、%Y/%m/%dで表示します。 showSuffixesInLink: false, // 曜日を表示するか否か:trueの場合、年月日の後に(火)のように表示します。 showDayOfWeek: false,
(3)Viewでの記述法
Layout等にJavaScriptおよびCSSのリンクタグを挿入します。
|
|
ここで、objectおよびmethodは、date_picker_helperを使って登録・編集を行うモ デルのオブジェクト名とメソッド名(列名)を指定します。
showSuffixesは、年、月、日の文字をつけるか否か、showWDayは、曜日を表示する か否かを指定します。
showSuffixesおよびshowWDayは省略可能で、省略した場合falseとして扱われます。

