开发者

CRUD module does not support Calendar type?

CRUD module is so cool but small problem.

I am using 'Calendar' types in model classes, and they do not appear in CRUD pages. Once their types changed to 'Date' from 'Calendar', they appear.

It seems that CRUD does not support Calendar type.

Q开发者_运维技巧uestion. How can I use Calendar type in model classes for CRUD module?

You may simply suggest that I should use Date instead of Calendar. But it does not fit to my project because Date types do not work in some cases in my project.

Thank you.

FYI, one of the model classes

@Entity
@Table(name = "brands")
public class Brand extends Model {
@Column
public String name;

@Column
public Calendar modified_at;

@Column
public Calendar created_at;

...
}

Only name field is showed at CRUD pages. But modified_at and created_at also appear once the types changed to 'Date'.


CRUD is a basic module, it lacks support for several things (for example, dates only display the dd/mm/yyyy part, not the hour or minute).

You may need to customize it. The code is available here as well as in the Play! distribution you have, in the "modules" folder. Just modify the content to suit you needs and deploy it as a local module in your dependencies file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜