質問編集履歴
2
コード修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -176,7 +176,7 @@
|
|
176
176
|
|
177
177
|
}
|
178
178
|
|
179
|
-
else if (view.type == "agendaDa") {
|
179
|
+
else if (view.type == "agendaDay") {
|
180
180
|
|
181
181
|
document.getElementsByClassName('fc-prev-button fc-button fc-state-default fc-corner-left')[0].textContent = "前日"
|
182
182
|
|
1
回答を受けて自分なりに考えてコードを修正。
test
CHANGED
File without changes
|
test
CHANGED
@@ -115,3 +115,99 @@
|
|
115
115
|
});
|
116
116
|
|
117
117
|
```
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
```
|
122
|
+
|
123
|
+
回答を受けて自分なりに考えてコードを修正。
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
$('#calendar').fullCalendar({
|
130
|
+
|
131
|
+
events: '/events.json',
|
132
|
+
|
133
|
+
//カレンダー上部を年月で表示させる
|
134
|
+
|
135
|
+
titleFormat: 'YYYY年 M月',
|
136
|
+
|
137
|
+
//曜日を日本語表示
|
138
|
+
|
139
|
+
dayNamesShort: ['日', '月', '火', '水', '木', '金', '土'],
|
140
|
+
|
141
|
+
//ボタンのレイアウト
|
142
|
+
|
143
|
+
header: {
|
144
|
+
|
145
|
+
// title, prev, next, prevYear, nextYear, today
|
146
|
+
|
147
|
+
left: 'prev,next today',
|
148
|
+
|
149
|
+
center: 'title',
|
150
|
+
|
151
|
+
right: 'month agendaWeek agendaDay'
|
152
|
+
|
153
|
+
},
|
154
|
+
|
155
|
+
events: '/store_managers/<%= @id %>/reservations.json',
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
// 「月」「週」「日」によっての条件訳
|
160
|
+
|
161
|
+
eventAfterRender : function(event, element, view) {
|
162
|
+
|
163
|
+
if (view.type == "agendaWeek") {
|
164
|
+
|
165
|
+
document.getElementsByClassName('fc-prev-button fc-button fc-state-default fc-corner-left')[0].textContent = "前週"
|
166
|
+
|
167
|
+
document.getElementsByClassName('fc-next-button fc-button fc-state-default fc-corner-right')[0].textContent = "次週"
|
168
|
+
|
169
|
+
}
|
170
|
+
|
171
|
+
else if (view.type == "month") {
|
172
|
+
|
173
|
+
document.getElementsByClassName('fc-prev-button fc-button fc-state-default fc-corner-left')[0].textContent = "前月"
|
174
|
+
|
175
|
+
document.getElementsByClassName('fc-prev-button fc-button fc-state-default fc-corner-right')[0].textContent = "次月"
|
176
|
+
|
177
|
+
}
|
178
|
+
|
179
|
+
else if (view.type == "agendaDa") {
|
180
|
+
|
181
|
+
document.getElementsByClassName('fc-prev-button fc-button fc-state-default fc-corner-left')[0].textContent = "前日"
|
182
|
+
|
183
|
+
document.getElementsByClassName('fc-prev-button fc-button fc-state-default fc-corner-right')[0].textContent = "翌日"
|
184
|
+
|
185
|
+
}
|
186
|
+
|
187
|
+
},
|
188
|
+
|
189
|
+
//ヘッダーボタンの名前
|
190
|
+
|
191
|
+
buttonText: {
|
192
|
+
|
193
|
+
prev: '前',
|
194
|
+
|
195
|
+
next: '次',
|
196
|
+
|
197
|
+
prevYear: '前年',
|
198
|
+
|
199
|
+
nextYear: '翌年',
|
200
|
+
|
201
|
+
today: '今日',
|
202
|
+
|
203
|
+
month: '月',
|
204
|
+
|
205
|
+
week: '週',
|
206
|
+
|
207
|
+
day: '日'
|
208
|
+
|
209
|
+
}
|
210
|
+
|
211
|
+
});
|
212
|
+
|
213
|
+
```
|