Skip to content
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

make DynamicDateRange.js control available in forms #4130

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stesap
Copy link

@stesap stesap commented Sep 25, 2024

Change

This change will add support for forms (sap.ui.layout.form.Form) and form container (sap.ui.layout.form.FormContainer) on DynamicDateRange control.

Motivation

The DynamicDateRange control is shown in the UI5 samples page mostly as a filter for a table. It would also be helpful to have this input control in a form as well. At least we tested this successfully in our app and haven't seen any issues so far.

This change will add support for forms (`sap.ui.layout.form.Form`) and form container (`sap.ui.layout.form.FormContainer`) on DynamicDateRange control.
Copy link

cla-assistant bot commented Sep 25, 2024

CLA assistant check
All committers have signed the CLA.

@MapTo0
Copy link
Member

MapTo0 commented Sep 26, 2024

Hello @stesap ,

Thank you for your pull request. I've created an internal record DINC0279997. The status of the issue will be updated here in GitHub.

Regards,
Martin

@DMihaylova
Copy link
Contributor

Hi @stesap,

Could you please share your scenario?
Dynamic Date Range could have different value types (e.g. "Yesterday", single date, date range, from/to, etc) which makes it impossible for binding. How you plan to format it after the form validation?

Thanks & Regards,
Diana

@stesap
Copy link
Author

stesap commented Sep 30, 2024

Hi @DMihaylova, in our app we're using the control to provide relative dates:

  • Today
  • First Day of Current Month
  • Last Day of Previous Month (not available in sap.m.StandardDynamicDateRangeKeys)

In addition as we use these values as a relative date in the database, to create schedules for automated runs in the future.
Therefore we find it inconvenient for the user, to display a certain date in brackets (see method DynamicDateRange.prototype._enhanceInputValue), which is misleading for our schedule. And the option for last day of previous month is not available.

To support the binding, we implemented a custom type, which does the parsing and formatting. Maybe, it's possible to support these via interfaces and methods which needs to be implemented by developers? Similar to the sap.m.DynamicDateOption where custom options need to implement format/parse/validate methods?

-Steffen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants