2023.02.06 - [FullCalendar v6] 03. Sizing (달력 크기 설정), headerDates 고정

 

[FullCalendar v6] Sizing (달력 크기 설정), headerDates 고정

2023.02.06 - [FullCalendar v6] 02. Toolbar 설정 (headerToolbar, footerToolbar), 한국어 설정 (locale) [FullCalendar v6] 02. Toolbar 설정 (headerToolbar, footerToolbar), 한국어 설정 (locale) 2023.02.06 - [FullCalendar v6] 01. 시작하기 [Full

my-bapberi.tistory.com

 

 

이전에 locale을 ko 한국어로 변경하면서

cell에 숫자만 들어가 있던게 7일, 8일 이런식으로 "일"이 붙어버렸다.

단순하게 숫자만 나타내기 위해

"일"을 제거해보자!!

var calendar = new FullCalendar.Calendar(calendarEl, {
    ...

    dayCellContent: function (arg) {
      const { date } = arg;
      return date.getDate();
    },
    
    ...
});

arg 안에 Date 타입의 date가 들어있다.

더 자세한 property를 보려면 참고 >>> https://fullcalendar.io/docs/day-cell-render-hooks

 

아무튼, Date 타입이니까 getDate() 메소드로 숫자만 쏙 빼줘서 return 해주면

원하는 대로 cell에 숫자만 표시된다.

 

 

 

+ Recent posts