GithubHelp home page GithubHelp logo

gpc / joda-time Goto Github PK

View Code? Open in Web Editor NEW
25.0 25.0 38.0 5.08 MB

A plugin that Integrates the Joda Time date/time library into Grails

Home Page: http://gpc.github.com/joda-time

License: Apache License 2.0

Groovy 98.73% Shell 1.27%

joda-time's People

Contributors

bobbywarner avatar burtbeckwith avatar colinharrington avatar graemerocher avatar hbogaards avatar jamescookie avatar michaelcameron avatar puneetbehl avatar robertoschwald avatar robfletcher avatar sbglasius avatar stokito avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

joda-time's Issues

Plugin Descriptor in 2.0.0 errors

The current plugin descriptor seem to have wrong urls for documentation, issue management, etc. in it.
It is currently very hard to figure out how to configure the plugin in Grails 3.

Documentation URL does not exist (Should this point to https://gpc.github.io/joda-time/latest/ instead?):

    def documentation = "http://grails.org/plugin/grails-joda-time"

Issue Management URL is outdated and does not exist anymore (GH issues instead?):

def issueManagement = [system: 'JIRA', url: 'http://jira.grails.org/browse/GPJODATIME']

Issue with SAML integraion

Not sure why this happens, but when I installed grails SAML plugin for SSO it broke joda-time to work.
SSO plugin http://docs.spring.io/spring-security-saml/docs/1.0.x/reference/html/index.html
joda-time version 1.4
grails verstion 2.0.3


exception I got is the following:

/<APP_NAME>/order/entry

Class
groovy.lang.MissingMethodException
Message
No signature of method: static org.joda.time.DateTime.now() is applicable for argument types: (org.joda.time.tz.CachedDateTimeZone) values: [America/New_York] Possible solutions: era(), next(), any(), get(org.joda.time.DateTimeField), get(org.joda.time.DateTimeFieldType), get(org.joda.time.DateTimeFieldType)

Undocumented configuration change?

I am busy with a (long overdue) upgrade of a Grails2 app to Grails3. Part of the upgrade is maintaining the Joda Time functionality. This has likely succeeded, but with a configuration that is not documented. I am not sure if the plugin's workings have changed, or the documentation is incorrect, but I think it's worth noting.

Some facts about the app:

  • Grails Version: 3.3.6
  • Groovy Version: 2.4.15
  • JVM Version: 1.8.0_161
  • Hibernate: 5.1.5

Joda (related) dependencies in build.gradle:

compile 'org.grails.plugins:joda-time:2.1.0'
compile "org.jadira.usertype:usertype.jodatime:1.9"

In the Grails2 app the Joda <> Hibernate mapping was in a grails.gorm.default.mapping entry in Config.groovy. I moved this to application.groovy, which is the correct place according to this plugin's documentation (and install-mapping script). However, in the Grails3 app grails.gorm.default.mapping does not work. What does work, is using the grails.gorm.default.constraints entry. Like so:

grails.gorm.default.constraints = {
    "user-type" type: org.jadira.usertype.dateandtime.joda.PersistentDateTime, class: org.joda.time.DateTime
    "user-type" type: org.jadira.usertype.dateandtime.joda.PersistentDateTimeZoneAsString, class: org.joda.time.DateTimeZone
    "user-type" type: org.jadira.usertype.dateandtime.joda.PersistentDurationAsString, class: org.joda.time.Duration
    "user-type" type: org.jadira.usertype.dateandtime.joda.PersistentInstantAsMillisLong, class: org.joda.time.Instant
    "user-type" type: org.jadira.usertype.dateandtime.joda.PersistentInterval, class: org.joda.time.Interval
    "user-type" type: org.jadira.usertype.dateandtime.joda.PersistentLocalDate, class: org.joda.time.LocalDate
    "user-type" type: org.jadira.usertype.dateandtime.joda.PersistentLocalDateTime, class: org.joda.time.LocalDateTime
    "user-type" type: org.jadira.usertype.dateandtime.joda.PersistentLocalTime, class: org.joda.time.LocalTime
    "user-type" type: org.jadira.usertype.dateandtime.joda.PersistentPeriodAsString, class: org.joda.time.Period
    "user-type" type: org.jadira.usertype.dateandtime.joda.PersistentYears, class: org.joda.time.Years
}

(To be clear: it works fine in the app, but it seems undocumented - at least for this version of the plugin?)

JodaTime Domain properties are not listed as Persistent Properties

Grails 3.3.2
JDK 8

For example we have a domain User.groovy

package demoapp

import org.joda.time.LocalDate
import org.jadira.usertype.dateandtime.joda.PersistentDateTime

class User {

    LocalDate dateOfBirth

    static constraints = {
	dateOfBirth type: PersistentDateTime
    }
}

Now, when we run the following test it should pass:

    void "test joda time property on persistentEntity"() {
		when:
		assert domain.properties != null
        PersistentEntity persistentEntity = User.gormPersistentEntity
        List<PersistentProperty> properties = persistentEntity.persistentProperties
		
        then: "Joda property found on persistent entity"
        properties.any {it.type == LocalDate}
    }

Artifact name convention

The plugin artifact currently is named "joda-time-.jar".

Normally plugins use the convention

grails-plugin-<name>-<version>.jar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.