Skip to content

Commit

Permalink
fix(MonthPicker): 更新模态对话框文档 & 修复月份选择器 bug(#954)
Browse files Browse the repository at this point in the history
* docs(Modal): 模态对话框文档中没引入组件报错

* fix(MonthPicker): 修复月份选择器,选择下一年时,实际上选择了前一年
  • Loading branch information
nullptr-z committed Mar 14, 2023
1 parent dcaa410 commit acfa8c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/react-modal/README.md
Expand Up @@ -140,7 +140,7 @@ export default Demo;

```jsx mdx:preview&bg=#fff
import React from 'react';
import { Modal, ButtonGroup, Button, Form, Input, Textarea } from 'uiw';
import { Modal, ButtonGroup, Button, Form, Input, Textarea, Notify, Row, Col } from 'uiw';

class Demo extends React.Component {
constructor() {
Expand Down
4 changes: 3 additions & 1 deletion packages/react-month-picker/src/index.tsx
Expand Up @@ -106,7 +106,9 @@ export default function MonthPicker(props: MonthPickerProps) {
setType(captionType);
} else {
const year = new Date(panelDate).getFullYear();
const curPanelDate = new Date(new Date(panelDate).setFullYear(type === 'next' ? year + 1 : year - 1));
const curPanelDate = new Date(
new Date(panelDate).setFullYear(captionType === 'next' ? year + 1 : year - 1),
);
setPanelDate(curPanelDate);
}
}}
Expand Down

0 comments on commit acfa8c3

Please sign in to comment.