PikaDay.jsはカレンダー機能を入力フォームに付けるためのプログラムです。
Moment.jsに依存しています。
また、コードが読みやすいと感じました。
基本的な使い方
設定するパラメータ
メソッド
- picker.toString(フォーマット)
- 選択されている日付をMoment.jsのスタイルの日付フォーマットを指定して、それに沿った文字列を返す。
- picker.getDate()
- 選択されている日付のDateオブジェクトを返す。
- picker.setDate(日付の文字列)
- 指定した日付の文字列の日付を選択する。
- picker.getMoment()
- 選択されている日付のMomentオブジェクトを取得する。
- picker.setMoment(Momentオブジェクト)
- 指定したMomentオブジェクトの日付を選択する。
- picker.gotoToday()
- 今日の日付をカレンダーに表示する。
- picker.gotoMonth(月)
- 指定した月を表示する。(1月は0)
- picker.nextMonth(),picker.prevMonth()
- 先月、翌月を表示する。
- picker.gotoYear(年)
- 指定した年を表示する。
- picker.setMinDate(Dateオブジェクト), picker.setMaxDate(Dateオブジェクト)
- 指定したDateオブジェクトの日付を選択可能な日付の最小、最大にする。
- picker.isVisible()
- カレンダーが表示されているか
- picker.show()
- カレンダーを表示する。
- picker.hide()
- カレンダーを非表示にする。
- picker.adjustPosition()
- カレンダーの表示する場所を調整する。
- picker.destroy()
- カレンダーのDOMを削除する。