it技術:web開発:pikaday
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン最新のリビジョン両方とも次のリビジョン | ||
it技術:web開発:pikaday [2018/03/29 16:54] – [カレンダーの日本語化] yajuadmin | it技術:web開発:pikaday [2018/08/21 17:32] – yajuadmin | ||
---|---|---|---|
行 11: | 行 11: | ||
[[https:// | [[https:// | ||
+ | 基本的には、Moment.js のローカル版を使用する。 | ||
+ | |||
+ | === 下記はMoment.jsを使用しない場合 === | ||
今回は書式が決まっているため、Pikaday.jsを直接書き換えてしまいます。 | 今回は書式が決まっているため、Pikaday.jsを直接書き換えてしまいます。 | ||
<code javascript Pikaday.js> | <code javascript Pikaday.js> | ||
行 61: | 行 64: | ||
}, | }, | ||
</ | </ | ||
+ | |||
+ | === Moment.js のローカル版を使用する場合 === | ||
+ | 「moment.locale(' | ||
+ | |||
+ | <code javascript> | ||
+ | moment.locale(' | ||
+ | |||
+ | // the default output format for `.toString()` and `field` value | ||
+ | format: ' | ||
+ | |||
+ | // first day of week (0: Sunday, 1: Monday etc) | ||
+ | firstDay: 0, | ||
+ | |||
+ | // Additional text to append to the year in the calendar title | ||
+ | yearSuffix: ' | ||
+ | |||
+ | // Render the month after year in the calendar title | ||
+ | showMonthAfterYear: | ||
+ | |||
+ | // Render days of the calendar grid that fall in the next or previous month | ||
+ | showDaysInNextAndPreviousMonths: | ||
+ | |||
+ | // internationalization | ||
+ | i18n: { | ||
+ | previousMonth: | ||
+ | nextMonth: ' | ||
+ | months: moment.langData()._months, | ||
+ | weekdays: moment.localeData()._weekdays, | ||
+ | weekdaysShort: | ||
+ | } | ||
+ | </ | ||
+ | |||
=== 土日の色を変更する === | === 土日の色を変更する === |
it技術/web開発/pikaday.txt · 最終更新: 2018/08/22 11:02 by yajuadmin