CRUD module: please add support for timestamp fields
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
play framework |
New
|
Undecided
|
Unassigned | ||
1.1 |
New
|
Undecided
|
Unassigned |
Bug Description
I have the need to retrieve time values from the user. The Java Date class encapsulates both date and time values. Would be nice if CRUD could allow input of date AND time.
Some thoughts on how to implement:
1. Add annotation(s) to the play.models.Model class (or maybe it should go in validation?):
@DateAndTim
@TimeField
2. In the case of @DateAndTimeField, have CRUD generate two input tags - one for the date portion, the other for the time portion. Then, have a hidden field that contains the full timestamp value and that will be submitted to the actual Date field. For example:
public class MyClass extends Model {
@DateAndTim
public Date appointment;
}
CRUD-generated show/blank forms:
<!-- the date portion of the appointment -->
<input type="text" id="object_
<!-- the time portion of the appointment -->
<input type="text" id="object_
<!-- the hidden field that hold the fully qualified timestamp - will need to listen to changes to both fields -->
<input type="hidden" name="object.
Thanks in advance! Love Play! Also, after some more experience, I'd like to get involved with contributing code to the Play! project.
Mark
Id like to add my support to the above proposal
Ran into this problem myself and the above looks promising