Skip to content

Commit

Permalink
Merge pull request ant-design#1806 from forthedamn/translation-calendar
Browse files Browse the repository at this point in the history
Translation calendar
  • Loading branch information
RaoHai committed May 26, 2016
2 parents 56f4f06 + 3206196 commit 780377a
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 6 deletions.
11 changes: 10 additions & 1 deletion components/calendar/demo/basic.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
---
order: 0
title: 基本
title:
zh-CN: 基本
en-US: Basic
---

## zh-CN

一个通用的日历面板,支持年/月切换。


## en-US

A basic calendar component with Year/Month switch.

````jsx
import { Calendar } from 'antd';

Expand Down
10 changes: 9 additions & 1 deletion components/calendar/demo/card.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
---
order: 10
title: 卡片模式
title:
zh-CN: 卡片模式
en-US: Card
---

## zh-CN

用于嵌套在空间有限的容器中。

## en-US

Nested inside a container element for rendering in limited space.

````jsx
import { Calendar } from 'antd';

Expand Down
10 changes: 9 additions & 1 deletion components/calendar/demo/custom-render.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
---
order: 1
title: 自定义渲染
title:
zh-CN: 自定义渲染
en-US: Custom Render
---

## zh-CN

`dateCellRender``monthCellRender` 函数来自定义需要渲染的数据。

## en-US

This component can be rendered by using `dateCellRender` and `monthCellRender` with the data you need.

````jsx
import { Calendar } from 'antd';

Expand Down
10 changes: 9 additions & 1 deletion components/calendar/demo/locale.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
---
order: 4
title: 国际化
title:
zh-CN: 国际化
en-US: locale
---

## zh-CN

通过 `locale` 配置时区、语言等, 默认支持 en_US, zh_CN

## en_US

To set the properties like time zone, language and etc. en_US, zh_CN are supported by default.

````jsx
import { Calendar } from 'antd';
import enUS from 'antd/lib/calendar/locale/en_US';
Expand Down
12 changes: 10 additions & 2 deletions components/calendar/demo/notice-calendar.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
---
order: 2
title: 通知事项日历演示
title:
zh-CN: 通知事项日历演示
en-US: A demo of Notice Calendar
---

一个复杂的应用实例。
## zh-CN

一个复杂的应用示例。

## en_US

A complex application.

````jsx
import { Calendar } from 'antd';
Expand Down
33 changes: 33 additions & 0 deletions components/calendar/index.en-US.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
category: Components
type: Presentation
cols: 1
title: Calendar
---

When to use container for displaying data in calendar form.

## When to use

When data is in the form of date, such as schedule, timetable, prices calendar, Lunar calendar. This component also supports Year/Month switch.

## API

```html
<Calendar
dateCellRender={dateCellRender}
monthCellRender={monthCellRender}
onPanelChange={onPanelChange}
/>
```

| Property | Description | Type | Default |
|--------------|----------------|----------|--------------|
| value | set date | Date | current date |
| defaultValue | set default date | Date | current date |
| mode | can be set to month or year | string | month |
| fullscreen | to set whether full-screen display | bool | true |
| dateCellRender | to set the way of renderer the date cell| function([GregorianCalendar](https://github.com/yiminghe/gregorian-calendar/))| - |
| monthCellRender | to set the way of renderer the month cell | function([GregorianCalendar](https://github.com/yiminghe/gregorian-calendar/)) | - |
| locale | set locale | object | [defualt](https://github.com/ant-design/ant-design/issues/424) |
| onPanelChange| the callback when panel change | function(date, mode) | - |
File renamed without changes.

0 comments on commit 780377a

Please sign in to comment.