3

I am using Grails 2.0.3 (groovy 1.8.6) with joda-time:1.3.1 and joda-time-templates plugins. Everything works perfectly but I would like to change displayed format for date and time. How can I do that? Every domain is scaffolded so I do not have access to any view to render it manually.

My domain

import org.joda.time.*
import org.joda.time.contrib.hibernate.*

    class Game {

        Team host
        Team guest
        String location
        DateTime date


        static mapping = {
            date type: PersistentDateTimeTZ, {
                column name: "date_timestamp"
                column name: "date_zone"
            }
        }
    }

rendered date

Date 5/24/12 5:53 PM

I would like to get it as

Date 5 may 2012 17:53 PM 

Is there any way to translate name of month

mrok
  • 2,680
  • 3
  • 27
  • 46

1 Answers1

2

define this in config.groovy

jodatime {  format.org.joda.time.DateTime = "dd MMM YYYY HH:mm a" }

and that should take care of it.

allthenutsandbolts
  • 1,513
  • 1
  • 13
  • 34