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
}
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.
Subscribe to:
Post Comments (Atom)
4 comments:
What are the properties?
Check yourself by changing following
class 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..
Is 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.
Post a Comment