Skip to content

Commit

Permalink
swap-ui 1.0.126: 調整DatePicker
Browse files Browse the repository at this point in the history
DatePicker: 修正年bug
  • Loading branch information
clothe09986 committed Feb 16, 2022
1 parent 276c868 commit 587fe31
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@yosgo/swap-ui",
"version": "1.0.125",
"version": "1.0.126",
"main": "build/index.js",
"module": "build/index.esm.js",
"files": [
Expand Down
9 changes: 8 additions & 1 deletion src/DatePicker/DatePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,17 @@ const DatePicker: React.FC<DatePickerProps> = (props): React.ReactElement => {
} = props;
const [year, setYear] = useState(Number(new Date().getFullYear()));
const [month, setMonth] = useState(Number(new Date().getMonth() + 1));
const [nextMonth, setNextMonth] = useState(1);
const [nextMonth, setNextMonth] = useState(Number(new Date().getMonth() + 2));
const [date, setDate] = useState("");
const [isOpenMonthSelector, setIsOpenMonthSelector] = useState(false);
const [isClicked, setIsClicked] = useState(false);

useEffect(() => {
if (month === 12) {
setNextMonth(1);
}
}, []);

useEffect(() => {
if (format === "month") {
if (month % 2 === 0) {
Expand Down

0 comments on commit 587fe31

Please sign in to comment.