diff --git a/README.md b/README.md new file mode 100644 index 0000000..6eee22c --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +[![Maven Central](https://img.shields.io/maven-central/v/no.datek/slim-spring-webmvc.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22no.datek%22%20AND%20a:%22slim-spring-webmvc%22) + +* https://s01.oss.sonatype.org/ +* https://s01.oss.sonatype.org/content/repositories/releases/no/datek/ +* https://search.maven.org/ +* https://search.maven.org/search?q=slim-spring-webmvc \ No newline at end of file diff --git a/build.gradle b/build.gradle index c2a8b98..4d1b235 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { } group 'no.datek' -version '0.0.6' +version '0.0.7' java { withJavadocJar() diff --git a/src/main/resources/ruby/controller_utils.rb b/src/main/resources/ruby/controller_utils.rb index e503f1f..91163fe 100644 --- a/src/main/resources/ruby/controller_utils.rb +++ b/src/main/resources/ruby/controller_utils.rb @@ -7,24 +7,16 @@ def current_locale(request) locale end - if defined?(Java::NoDatekM2mWebLightsController::ControllerUtils) - def message_source - messageSource = ReloadableResourceBundleMessageSource.new - messageSource.setCacheSeconds(300) - messageSource.setBasenames("classpath:lights_version", "classpath:lightsMessages") - ControllerUtils.setMessageSource(messageSource) - M2mException.setMessageSource(messageSource) - end - def message_source_accessor(locale) - MessageSourceAccessor.new(message_source(locale), locale) - end - else - def message_source - nil - end - def message_source_accessor(locale) - nil - end + @@message_source = Java::org.springframework.context.support::ReloadableResourceBundleMessageSource.new + @@message_source.setCacheSeconds(300) + @@message_source.setBasenames("classpath:lights_version", "classpath:lightsMessages") + Java::no.datek.m2m.kernel.exceptions::M2mException.setMessageSource(@@message_source) + + def message_source + @@message_source end + def message_source_accessor(locale) + MessageSourceAccessor.new(message_source, locale) + end end diff --git a/src/main/resources/ruby/slim_helper.rb b/src/main/resources/ruby/slim_helper.rb index 19f0d9e..fc58b87 100644 --- a/src/main/resources/ruby/slim_helper.rb +++ b/src/main/resources/ruby/slim_helper.rb @@ -235,7 +235,7 @@ def [](field_name) yield bs end - def formatDateTime(date_time, format = 'yyyy-MM-dd HH:mm:ss', timeZoneId: TimeZoneHelper.current_timezone(user)) + def formatDateTime(date_time, format = 'yyyy-MM-dd HH:mm:ss', timeZoneId: TimeZoneHelper.current_time_zone(user)) if date_time.nil? return '' end