Skip to content

Commit

Permalink
docs(Calendar): fix inconsistencies between the document and "demo" (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
pany-ang authored Aug 14, 2024
1 parent e9539da commit eef8e0b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions packages/vant/src/calendar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ export default {
const date = ref('');
const show = ref(false);

const formatDate = (date) => `${date.getMonth() + 1}/${date.getDate()}`;
const formatDate = (date) => {
return `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`;
};
const onConfirm = (value) => {
show.value = false;
date.value = formatDate(value);
Expand Down Expand Up @@ -227,7 +229,7 @@ Use `position` to custom popup position, can be set to `top`、`left`、`right`.
When selecting a date range, you can use the `max-range` prop to specify the maximum number of selectable days.

```html
<van-calendar type="range" :max-range="3" :style="{ height: '500px' }" />
<van-calendar type="range" :max-range="3" />
```

### Custom First Day Of Week
Expand Down
6 changes: 4 additions & 2 deletions packages/vant/src/calendar/README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ export default {
const date = ref('');
const show = ref(false);

const formatDate = (date) => `${date.getMonth() + 1}/${date.getDate()}`;
const formatDate = (date) => {
return `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`;
};
const onConfirm = (value) => {
show.value = false;
date.value = formatDate(value);
Expand Down Expand Up @@ -231,7 +233,7 @@ export default {
选择日期区间时,可以通过 `max-range` 属性来指定最多可选天数,选择的范围超过最多可选天数时,会弹出相应的提示文案。

```html
<van-calendar type="range" :max-range="3" :style="{ height: '500px' }" />
<van-calendar type="range" :max-range="3" />
```

### 自定义周起始日
Expand Down

0 comments on commit eef8e0b

Please sign in to comment.