ライブラリ
カスタマイズ
//ヘッダー
fsCalendar.appearance.headerMinimumDissolvedAlpha = 0 //前月、翌月表示のアルファ量(0で非表示)
// 水平方向(既定値)
fsCalendar.scrollDirection = .horizontal
セルのデザイン
func calendar(_ calendar: FSCalendar, willDisplay cell: FSCalendarCell, for date: Date, at position: FSCalendarMonthPosition) {
self.configure(cell: cell, for: date, at: position)
// cellのデザインを変更
// APIレスポンスの注文有効日とカレンダー上の日を比較して、同じであればセルを有効とする
}
前月、次月ボタン
// value 前月: -1, 次月: 1
let date = currentCalendar.date(byAdding: .month, value: value, to:calendar.currentPage)!
calendar.setCurrentPage(date, animated: true)
今日ボタン
// コードから日付を選択する
fsCalendar.select(fsCalendar.today)