DateField as TextField?

Hey everyone,

is it possible to use the DateField as a TextField? Now i use the DateField with a day-resolution and this field also should be able to fill with text like “ASAP”, “now”, “next week”, etc… (see attachment)
Here is a codeexample:

this one didn’t work if i put text in this field:

// Wunschtermin = desired date or desired deadline
private DateField datWunschtermin = new DateField("Wunschtermin");
....

// Binding via Hibernate:

Auftrag auftrag = new Auftrag();
auftrag.setWunschtermin(datWunschtermin.getValue().toString()); // Oracle: varchar2(100)

works, but this is only for date:

private DateField datWunschtermin = new DateField("Wunschtermin");
....

// Binding via Hibernate:

Auftrag auftrag = new Auftrag();
auftrag.setWunschtermin((Date)datWunschtermin.getValue()); // Oracle: date

Maybe, is it possible to use the calendar-popup from the datefield in a textfield?

Any ideas?

Best Regards
11907.jpg

You can at least extend the current DateField class and implement your own handleUnparsableDateString(String dateString) method to handle these textual representations of dates such as TODAY, TOMORROW etc. This should be a fairly trivial task but the bad side is you have to extend the DateField…

You might want to take a look at the
NaturalDate add-on
. Somewhat old and probably not quite what you want, but the same idea.