enhancement
critical
major
minor
minor
The CalendarMarker interface (see #23465) allows for the implementation of an algorithm that highlights or marks specific days in a DatePicker. It should now also be possible to specify the CalendarMarker implementation in the model by annotating the property field with a factory that produces the corresponding implementation.
Implementation
The factory required to annotate the CalendarMarkerhas been implemented as the MarkerFactory interface. It contains the function `getCalendarMarker(TLTypePart attribute, TLObject object, ComplexField field)`, which configures the ` CalendarMarker ` and returns it. \\ The annotation for a ` MarkerFactory ` is defined in the interface `com.top_logic.model.annotate.ui.MarkerFactoryAnnotation `. In com.top_logic.demo.webapp.WEB-INF.model.DemoTypes.model.xml, you can see an example of an annotation using a com.top_logic.demo.model.annotations.DemoMarkerFactory on DemoTypes.C.All.dependentDate. \\ To annotate a MarkerFactory in the model and pass parameters to it, the MarkerFactory implementation `com.top_logic.model.search.providers.MarkerFactoryByExpression` is now available. If this is annotated to a date field, the user can specify the start and end times of a period to be marked using a TL-Script function. In addition, the user can specify the CSS classes for calendar fields within or outside the time period, define how overlapping time periods are handled, and determine whether fields outside the time period should be made unselectable. There is already a default implementation, `com.top_logic.layout.form.control.DefaultCalendarMarker `, of the `CalendarMarker` interface that uses these values to determine how fields in a DatePicker should be marked.
Test
In the demo, for objects of type C`, the `dependentDate` attribute is annotated as follows: The boundaries of the highlight are the `date` and `date2` values of the parent node. A red or green highlight must be visible.