import { Controller } from '@hotwired/stimulus'; import { Datepicker } from 'flowbite-datepicker'; Datepicker.locales.ko = { days: ['일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일'], daysShort: ['일', '월', '화', '수', '목', '금', '토'], daysMin: ['일', '월', '화', '수', '목', '금', '토'], months: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], monthsShort: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], today: '오늘', clear: '삭제', format: 'yyyy-mm-dd', titleFormat: 'y년mm월', weekStart: 0, }; export default class extends Controller { static targets = ['input']; static values = { buttons: { type: Boolean, default: true }, autoSelectToday: { type: Boolean, default: false }, autohide: { type: Boolean, default: true }, format: { type: String, default: 'yyyy-mm-dd' }, maxDate: { type: String, default: null }, minDate: { type: String, default: null }, orientation: { type: String, default: 'auto' }, title: { type: String, default: '' }, language: { type: String, default: 'en' }, rangePicker: { type: Boolean, default: false }, todayHighlight: { type: Boolean, default: true }, }; connect() { const options = { buttons: this.buttonsValue, autoSelectToday: this.autoSelectTodayValue, autohide: this.autohideValue, format: this.formatValue, maxDate: this.maxDateValue, minDate: this.minDateValue, orientation: this.orientationValue, title: this.titleValue, language: this.languageValue, rangePicker: this.rangePickerValue, todayHighlight: this.todayHighlightValue, }; this.datepicker = new Datepicker(this.inputTarget, options); } show() { this.datepicker.show(); } disconnect() { if (this.datepicker) { this.datepicker.destroy(); this.datepicker = null; } } }

AltStyle によって変換されたページ (->オリジナル) /