-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Calendar] What's the exact type of selectedDates in the Calendar component #1730
Comments
Hi @SunnyWind, I'm not sure what the correct prop type is to be honest - I've created an issue (#1677) to clarify. Best regards, |
Hey @SunnyWind I'm just copy-pasting Vladi's answer from the Web Components Team. Best regards,
Originally posted by @vladitasev in #1677 (comment) |
Thanks for your answer, which can solve my problem. I want to replace the current calendar plugin (which is a YUI plugin) on our website with ui5-webcomponent calendar. Just replacing the calendar widget will be easier compared with using the DatePicker (Less modifications to HTML construct). |
I think this is a valid use case to be honest - @vladitasev does this justify a rework of the Calender to have a more declarative API? |
As this issue is focusing on a UI5 Web Component, I'll forward this issue to the respective repository. |
Yes, I think it makes sense to promote the Calendar as a real standalone component. We'll estimate what kind of effort will be required and we'll update you here. Regards |
The goal of the story is to make the calendar usable standalone. This would require all APIs to be re-evaluated and changed where necessary, it should have all necessary events, proper docs. |
Phase 1 - Make the ui5-calendar standalone and public component.There is а private ui5-calendar web component that is internally used by the 1. API to support
Note: timestamp and formatPattern should be private. 2. We would like to have single range selection. Currently if you set the following:
You will get: But, it is not possible to get it via user interaction. We have 3. Upon TAB the focus should move to the "selected day" or "today". 4. The components ( 5. The component has a test page (Calendar.html) that need to be improved:
6. The component has a test spec (Calendar.spec.js) that might has to be adjusted. 7. Properly document - add overview section, import info, etc (refer to the existing components and the openui5 equivalent for the text), remove all @ since tags and provide just one for the entire class @ since 1.0.0-rc.10 8. Playground sample - create Calendar.sample.html with few examples that showcase the component |
Hello @SunnyWind we introduced the Calendar as standalone component (ui5-calendar). The component is merged into the master, not yet released. This was the first step to achieve the goal. Now, we created a separate issue "Calendar: Declarative way of setting the selected days" that we will full-fill your request completely. You can track the progress here: #2528 BR, |
"CalendarSelection" enumeration is introduced with single, multiple and range selection modes. DayPicker component uses the new "CalendarSelection" class, in order to provide support for the three selection modes. Selection of multiple dates can be configured via the "selection" property of the Calendar component. Holding control keyboard key doesn't allow multiple dates selection. The logic for selecting a range of dates is moved from the DateRangePicker component into the DayPicker component. Selecting a range of dates via mouse now doesn't cause flickering on the hovered items. Updating the selected date range into the DateRangePicker component input field is now reflected visually, when the popover is opened. DateRangePicker now works properly with only start date of the range typed into the input field. Calendar navigation is now compliant with the specification. Playground sample is created. Fixes #1730
Hello @SunnyWind we introduced the Calendar as standalone component (ui5-calendar). The component is merged into the master #2424, it is not yet released. This was the first step to achieve the goal. Now, we created a separate issue "Calendar: Declarative way of setting the selected days" that we will full-fill your request completely. You can track the progress here: #2528 BR, |
Hi @ilhan007 Fantastic 👍 I use ui5-webcomponent-react instead of the base lib. I'll try it if the new feature is applied in that library. BRs, |
In the storybook, it says the type of selectedDates property is
unknown[]
, which is very unclear.On the other side, my editor tells me the type of the selectedDates is
number[]
.If I set the selectedDates to
[Date.now()/1000]
, I'll get an error:What kind of data should I pass to the Calendar component if I want to specify an initial date?
The text was updated successfully, but these errors were encountered: