fix(ui5-date-picker): prevent errors when CLDR data is not loaded
The CLDR data is loaded asynchronously during component definition via dynamic imports
customElements.whenDefined() resolves when the element is registered, not when async data is loaded
This caused a race condition where methods like isValidValue() could be called immediately after customElements.whenDefined() resolves, before the asynchronous CLDR data fetch completes.
DatePicker validation and formatting methods now return safe defaults when CLDR data is not yet loaded, instead of throwing errors.
Another possible solution would be to introduce a private event (something like 'cldr-load'), to re-render the component once the CLDR "becomes" available.
🚀 Deployed on https://pr-12807--ui5-webcomponents-preview.netlify.app
Overall these changes will prevent the errors in the console. However we should try to find a general solution regarding the issue with the CLDR. Also I think that will be good to add some logging in the PR when CLDR data is not loaded and try to use it.
The most efficient possible solution I discovered with the help of AI would bring breaking changes imo, so we should discuss those offline.