Hello Everyone,
I use a DateTimeItem to hold Date and Time information. But the user should only be able to change the time.
The Date Part is filled in by using the ".setEditorValueParser" and contains a fixed date (Provided by the program).*Edit
The Time Part should be entered by the user.
The Textfield of the DateTimeItem contains "<date> <time>" like "04.07.2017 18:14".
What i am trying, is to change the displayed text to "<time>" like "18:14".
I was able to change the Displayed Output like this:
But of cause this changes the Value of the DateTimeItem, too.
Is there a Way to change only the displayed text of the DateTimeItem?
I use a DateTimeItem to hold Date and Time information. But the user should only be able to change the time.
The Date Part is filled in by using the ".setEditorValueParser" and contains a fixed date (Provided by the program).*Edit
The Time Part should be entered by the user.
The Textfield of the DateTimeItem contains "<date> <time>" like "04.07.2017 18:14".
What i am trying, is to change the displayed text to "<time>" like "18:14".
I was able to change the Displayed Output like this:
Code:
this.setEditorValueFormatter((value, record, form, item) -> { Date date; if (value instanceof String) { date = LocalDateTimeConverter.localDateTimeStringToDate((String) value); } else { date = (Date) value; } return LocalTimeType.LOCAL_TIME_FORMAT.format(date); }
Is there a Way to change only the displayed text of the DateTimeItem?
Comment