-
Notifications
You must be signed in to change notification settings - Fork 2
[FRNT-570] Implement DatePicker #180
base: master
Are you sure you want to change the base?
Conversation
tatinacher
commented
Jul 21, 2021
- Write description and API
- Start implementing DatePicker component
|
По этому ПР прошу поглядеть описание, API и возможную реализацию (на данный момент компонент не реализован полностью), докинуть если чего не хватает. |
| "dependencies": { | ||
| "@use-date-input/core": "^0.2.1-beta.0", | ||
| "@use-date-input/dayjs-adapter": "^0.2.0-beta.0", | ||
| "dayjs": "^1.10.6", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
praise: кайфовая либа)
| format = 'DD.MM.YYYY', | ||
| icon, | ||
| initialDate = dayjs().format('DD.MM.YYYY'), | ||
| isOpen = false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Если это передается просто без хендлера, стоит наверное назвать как-то вроде defaultOpen / initialOpen, или добавить хендлер по типу onOpenChange. Мб еще можно в зависимости от того, передали снаружи isOpen и onOpenChange, использовать или их, или локальный isOpen
ainursharaev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Посмотри комментарии @risenforces
4461068 to
e5d4f70
Compare
| @@ -0,0 +1 @@ | |||
| export { DatePicker } from './date-picker'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question(blocking): Должен ли он находиться в этом пакете? Я думаю что стоит его переместить в пакет calendar, вынес этот вопрос на обсуждение
| @@ -0,0 +1,165 @@ | |||
| import 'react-calendar/dist/Calendar.css'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
в пакете calendar должно лежать)
| isDayDisabled?: ((props: CalendarTileProperties) => boolean) | undefined; | ||
| isOpen?: boolean; | ||
| locale?: string; | ||
| maxDate?: dayjs.Dayjs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Может обычный Date принимать во всех пропах или строку? А то получается что пользователю нужен пикер, а ему еще dayjs для этого импортировать, при том что он скорее нам внутри пикера нужен чем ему
e5d4f70 to
d50c7d1
Compare