class Person{and you're struggling to figure out a way to get stuff into it without explicitly creating a date and converting strings or integers into it, Grails provides a handy (yet not documented?) set of properties for you. In our example, I could set birthday_year, birthday_month, birthday_day, birthday_hour, etc.. I found this by digging in the scaffolded views and figuring out how they render the
String Name
Date Birthday
}
This blog is shared between Linden and Rachel, who are cousins. The purpose of the blog is to share interesting information, links, and events. We share interests such as Apple Computers, Gaming, SciFi and Fantasy, computers in general, Programming (yay Python), websites and building them, and cool things in general.
Thursday, March 06, 2008
Grails Date Trick
If you have a Date field in one of your domain classes, for instance:
tag. Now, maybe you don't have to dig.
This comment has been removed by a blog administrator.
ReplyDeleteWhat are the properties?
ReplyDeleteCheck yourself by changing following
ReplyDeleteclass Person{
String Name
Date Birthday
}
with
class Person{
String Name
java.sql.Date Birthday
}
specifying the property as java.sql.Date will render date control without hours and minutes fields.
I am struggling with the problem with dates..
ReplyDeleteIs it like if I will be declaring my date property using java.util.date
then it will in day month and year format and not those string to int and int to string conversions thing?
Please somebody reply soon..
Thanks.