-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from js-tool-pack/feat_#85
Feat #85
- Loading branch information
Showing
13 changed files
with
72 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,34 @@ | ||
/** | ||
* title: 从星期日开始 | ||
* title: 自定义星期的开始日 | ||
*/ | ||
|
||
import { Calendar } from '@tool-pack/react-ui'; | ||
import React from 'react'; | ||
import { Calendar, Select, Space } from '@tool-pack/react-ui'; | ||
import React, { useState } from 'react'; | ||
|
||
type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6; | ||
const weekDayNames = ['天', '一', '二', '三', '四', '五', '六'] as const; | ||
const options = weekDayNames.map((n, index) => ({ | ||
label: '星期' + n, | ||
value: index, | ||
})); | ||
|
||
const App: React.FC = () => { | ||
return <Calendar weekStart="SunDay" />; | ||
const [day, setDay] = useState<Day>(1); | ||
return ( | ||
<> | ||
<Space> | ||
星期开始日: | ||
<Select | ||
attrs={{ style: { width: '100px' } }} | ||
onChange={setDay} | ||
options={options} | ||
size="small" | ||
value={day} | ||
/> | ||
</Space> | ||
<Calendar firstDay={day} /> | ||
</> | ||
); | ||
}; | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.