logoAnt Design

⌘ K
  • 디자인
  • 개발
  • 컴포넌트
  • 블로그
  • 자료
5.21.3
  • Components Overview
  • General
    • Button
    • FloatButton
      5.0.0
    • Icon
    • Typography
  • Layout
    • Divider
    • Flex
      5.10.0
    • Grid
    • Layout
    • Space
    • Splitter
      5.21.0
  • Navigation
    • Anchor
    • Breadcrumb
    • Dropdown
    • Menu
    • Pagination
    • Steps
  • Data Entry
    • AutoComplete
    • Cascader
    • Checkbox
    • ColorPicker
      5.5.0
    • DatePicker
    • Form
    • Input
    • InputNumber
    • Mentions
    • Radio
    • Rate
    • Select
    • Slider
    • Switch
    • TimePicker
    • Transfer
    • TreeSelect
    • Upload
  • Data Display
    • Avatar
    • Badge
    • Calendar
    • Card
    • Carousel
    • Collapse
    • Descriptions
    • Empty
    • Image
    • List
    • Popover
    • QRCode
      5.1.0
    • Segmented
    • Statistic
    • Table
    • Tabs
    • Tag
    • Timeline
    • Tooltip
    • Tour
      5.0.0
    • Tree
  • Feedback
    • Alert
    • Drawer
    • Message
    • Modal
    • Notification
    • Popconfirm
    • Progress
    • Result
    • Skeleton
    • Spin
    • Watermark
      5.1.0
  • Other
    • Affix
    • App
      5.1.0
    • ConfigProvider
    • Util
      5.13.0

Calendar

달력 형태로 데이터를 표시하는 컨테이너.
가져오기import{ Calendar }from"antd";
소스components/calendar
문서
이 페이지 수정변경 로그

Resources

Ant Design Charts
Ant Design Pro
Ant Design Pro Components
Ant Design Mobile
Ant Design Mini
Ant Design Landing-Landing Templates
Scaffolds-Scaffold Market
Umi-React Application Framework
dumi-Component doc generator
qiankun-Micro-Frontends Framework
ahooks-React Hooks Library
Ant Motion-Motion Solution
China Mirror 🇨🇳

Community

Awesome Ant Design
Medium
Twitter
yuque logoAnt Design in YuQue
Ant Design in Zhihu
Experience Cloud Blog
seeconf logoSEE Conf-Experience Tech Conference
Work with Us

Help

GitHub
Change Log
FAQ
Bug Report
Issues
Discussions
StackOverflow
SegmentFault

Ant XTech logoMore Products

yuque logoYuQue-Document Collaboration Platform
AntV logoAntV-Data Visualization
Egg logoEgg-Enterprise Node.js Framework
Kitchen logoKitchen-Sketch Toolkit
Galacean logoGalacean-Interactive Graphics Solution
xtech logoAnt Financial Experience Tech
Theme Editor
Made with ❤ by
Ant Group and Ant Design Community
loading

언제 사용하나요?

스케줄, 시간표, 가격 캘린더, 음력 달력과 같은 날짜 형태의 데이터가 있는 경우 사용합니다. 또한 Calendar 컴포넌트는 연/월 전환을 지원합니다.

예시

API

공통 props 참조:공통 props

참고: 캘린더의 일부 locale은 value에서 읽혀집니다. 따라서, dayjs의 locale을 올바르게 설정해주세요.

// 기본 locale은 en-US 입니다. 다른 locale을 사용하고 싶다면, 전역적으로 entry file 에서 locale을 설정하세요.
// import dayjs from 'dayjs';
// import 'dayjs/locale/zh-cn';
// dayjs.locale('zh-cn');
<Calendar cellRender={cellRender} onPanelChange={onPanelChange} onSelect={onSelect} />
PropertyDescriptionTypeDefaultVersion
cellRender셀 내용 커스텀function(current: dayjs, today: dayjs, info: { originNode: React.ReactElement,today: DateType, range?: 'start' | 'end', type: PanelMode, locale?: Locale, subType?: 'hour' | 'minute' | 'second' | 'meridiem' }) => React.ReactNode-5.4.0
dateFullCellRender날짜 셀의 외형를 커스텀하여 셀을 덮어씁니다.function(date: Dayjs): ReactNode-
fullCellRender셀 내용 커스텀function(current: dayjs, today: dayjs, info: { originNode: React.ReactElement,today: DateType, range?: 'start' | 'end', type: PanelMode, locale?: Locale, subType?: 'hour' | 'minute' | 'second' | 'meridiem' }) => React.ReactNode-5.4.0
defaultValue기본으로 선택된 날짜dayjs-
disabledDate선택할 수 없는 날짜를 지정하는 함수, currentDate는 value 속성과 동일한 dayjs 객체입니다 (이 객체를 변형해서는 안 됩니다)](https://github.com/ant-design/ant-design/issues/30987)(currentDate: Dayjs) => boolean-
fullscreen전체 화면으로 표시 여부booleantrue
headerRender패널에 사용자 정의 헤더 렌더링function(object:{value: Dayjs, type: string, onChange: f(), onTypeChange: f()})-
locale달력의 localeobject(default)
mode달력의 표시 모드month | yearmonth
validRange유효 범위 설정[dayjs, dayjs]-
value현재 선택된 날짜dayjs-
onChange날짜 변경 시 콜백function(date: Dayjs)-
onPanelChange패널 변경 시 콜백function(date: Dayjs, mode: string)-
onSelectsource info 를 포함하는 날짜를 선택할 시 콜백function(date: Dayjs, info: { source: 'year' | 'month' | 'date' | 'customize' })-info: 5.6.0

Design Token

컴포넌트 토큰어떻게 사용하나요?

토큰 이름설명타입기본값
fullBg完整日历背景色string#ffffff
fullPanelBg完整日历面板背景色string#ffffff
itemActiveBg日期项选中背景色string#e6f4ff
miniContentHeight迷你日历内容高度string | number256
monthControlWidth月选择器宽度string | number70
yearControlWidth年选择器宽度string | number80

글로벌 토큰어떻게 사용하나요?

FAQ

어떻게 커스텀 날짜 라이브러리로 Calendar를 사용하나요?

커스텀 날짜 라이브러리 사용하기를 참조하세요.

어떻게 날짜 관련 컴포넌트의 locale을 설정하나요?

날짜 관련 컴포넌트의 로케일 설정 방법을 참조하세요.

날짜 관련 컴포넌트의 로케일이 작동하지 않나요?

자주 묻는 질문 날짜 관련 컴포넌트의 로케일이 작동하지 않나요?을 참조하세요.

패널 클릭으로 날짜를 어떻게 얻나요?

onSelect는 이를 위해 info.source를 제공합니다.

<Calendar
onSelect={(date, { source }) => {
if (source === 'date') {
console.log('Panel Select:', source);
}
}}
/>
Basic
codepen icon
External Link Icon
expand codeexpand code
Notice Calendar
codepen icon
External Link Icon
expand codeexpand code
Card
codepen icon
External Link Icon
expand codeexpand code
Selectable Calendar
codepen icon
External Link Icon
expand codeexpand code
Lunar Calendar
codepen icon
External Link Icon
expand codeexpand code
Customize Header
codepen icon
External Link Icon
expand codeexpand code
Component Token
codepen icon
External Link Icon
expand codeexpand code
2024
Oct
SuMoTuWeThFrSa
29
30
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
01
02
03
04
05
06
07
08
09
2024
Oct
SuMoTuWeThFrSa
29
    30
      01
        02
          03
            04
              05
                06
                  07
                    08
                    • This is warning event.
                    • This is usual event.
                    09
                      10
                      • This is warning event.
                      • This is usual event.
                      • This is error event.
                      11
                        12
                          13
                            14
                              15
                              • This is warning event
                              • This is very long usual event......
                              • This is error event 1.
                              • This is error event 2.
                              • This is error event 3.
                              • This is error event 4.
                              16
                                17
                                  18
                                    19
                                      20
                                        21
                                          22
                                            23
                                              24
                                                25
                                                  26
                                                    27
                                                      28
                                                        29
                                                          30
                                                            31
                                                              01
                                                                02
                                                                  03
                                                                    04
                                                                      05
                                                                        06
                                                                          07
                                                                            08
                                                                            • This is warning event.
                                                                            • This is usual event.
                                                                            09
                                                                              2024
                                                                              Oct
                                                                              SuMoTuWeThFrSa
                                                                              29
                                                                              30
                                                                              01
                                                                              02
                                                                              03
                                                                              04
                                                                              05
                                                                              06
                                                                              07
                                                                              08
                                                                              09
                                                                              10
                                                                              11
                                                                              12
                                                                              13
                                                                              14
                                                                              15
                                                                              16
                                                                              17
                                                                              18
                                                                              19
                                                                              20
                                                                              21
                                                                              22
                                                                              23
                                                                              24
                                                                              25
                                                                              26
                                                                              27
                                                                              28
                                                                              29
                                                                              30
                                                                              31
                                                                              01
                                                                              02
                                                                              03
                                                                              04
                                                                              05
                                                                              06
                                                                              07
                                                                              08
                                                                              09
                                                                              You selected date: 2017-01-25
                                                                              2017
                                                                              Jan
                                                                              SuMoTuWeThFrSa
                                                                              01
                                                                              02
                                                                              03
                                                                              04
                                                                              05
                                                                              06
                                                                              07
                                                                              08
                                                                              09
                                                                              10
                                                                              11
                                                                              12
                                                                              13
                                                                              14
                                                                              15
                                                                              16
                                                                              17
                                                                              18
                                                                              19
                                                                              20
                                                                              21
                                                                              22
                                                                              23
                                                                              24
                                                                              25
                                                                              26
                                                                              27
                                                                              28
                                                                              29
                                                                              30
                                                                              31
                                                                              01
                                                                              02
                                                                              03
                                                                              04
                                                                              05
                                                                              06
                                                                              07
                                                                              08
                                                                              09
                                                                              10
                                                                              11
                                                                              二〇二四年(甲辰龙年)
                                                                              10月(八月)
                                                                              SuMoTuWeThFrSa
                                                                              29
                                                                              廿七
                                                                              30
                                                                              廿八
                                                                              1
                                                                              国庆节
                                                                              2
                                                                              三十
                                                                              3
                                                                              初一
                                                                              4
                                                                              初二
                                                                              5
                                                                              初三
                                                                              6
                                                                              初四
                                                                              7
                                                                              初五
                                                                              8
                                                                              寒露
                                                                              9
                                                                              初七
                                                                              10
                                                                              初八
                                                                              11
                                                                              初九
                                                                              12
                                                                              初十
                                                                              13
                                                                              十一
                                                                              14
                                                                              十二
                                                                              15
                                                                              十三
                                                                              16
                                                                              十四
                                                                              17
                                                                              十五
                                                                              18
                                                                              十六
                                                                              19
                                                                              十七
                                                                              20
                                                                              十八
                                                                              21
                                                                              十九
                                                                              22
                                                                              二十
                                                                              23
                                                                              霜降
                                                                              24
                                                                              廿二
                                                                              25
                                                                              廿三
                                                                              26
                                                                              廿四
                                                                              27
                                                                              廿五
                                                                              28
                                                                              廿六
                                                                              29
                                                                              廿七
                                                                              30
                                                                              廿八
                                                                              31
                                                                              廿九
                                                                              1
                                                                              初一
                                                                              2
                                                                              初二
                                                                              3
                                                                              初三
                                                                              4
                                                                              初四
                                                                              5
                                                                              初五
                                                                              6
                                                                              初六
                                                                              7
                                                                              立冬
                                                                              8
                                                                              初八
                                                                              9
                                                                              初九

                                                                              Custom header

                                                                              2024
                                                                              Oct
                                                                              SuMoTuWeThFrSa
                                                                              29
                                                                              30
                                                                              01
                                                                              02
                                                                              03
                                                                              04
                                                                              05
                                                                              06
                                                                              07
                                                                              08
                                                                              09
                                                                              10
                                                                              11
                                                                              12
                                                                              13
                                                                              14
                                                                              15
                                                                              16
                                                                              17
                                                                              18
                                                                              19
                                                                              20
                                                                              21
                                                                              22
                                                                              23
                                                                              24
                                                                              25
                                                                              26
                                                                              27
                                                                              28
                                                                              29
                                                                              30
                                                                              31
                                                                              01
                                                                              02
                                                                              03
                                                                              04
                                                                              05
                                                                              06
                                                                              07
                                                                              08
                                                                              09
                                                                              2024
                                                                              Oct
                                                                              SuMoTuWeThFrSa
                                                                              29
                                                                              30
                                                                              01
                                                                              02
                                                                              03
                                                                              04
                                                                              05
                                                                              06
                                                                              07
                                                                              08
                                                                              09
                                                                              10
                                                                              11
                                                                              12
                                                                              13
                                                                              14
                                                                              15
                                                                              16
                                                                              17
                                                                              18
                                                                              19
                                                                              20
                                                                              21
                                                                              22
                                                                              23
                                                                              24
                                                                              25
                                                                              26
                                                                              27
                                                                              28
                                                                              29
                                                                              30
                                                                              31
                                                                              01
                                                                              02
                                                                              03
                                                                              04
                                                                              05
                                                                              06
                                                                              07
                                                                              08
                                                                              09

                                                                              2024
                                                                              Oct
                                                                              SuMoTuWeThFrSa
                                                                              29
                                                                              30
                                                                              01
                                                                              02
                                                                              03
                                                                              04
                                                                              05
                                                                              06
                                                                              07
                                                                              08
                                                                              09
                                                                              10
                                                                              11
                                                                              12
                                                                              13
                                                                              14
                                                                              15
                                                                              16
                                                                              17
                                                                              18
                                                                              19
                                                                              20
                                                                              21
                                                                              22
                                                                              23
                                                                              24
                                                                              25
                                                                              26
                                                                              27
                                                                              28
                                                                              29
                                                                              30
                                                                              31
                                                                              01
                                                                              02
                                                                              03
                                                                              04
                                                                              05
                                                                              06
                                                                              07
                                                                              08
                                                                              09