Skip to content

Commit

Permalink
Release version 0.0.7 with use of controller_utils.rb fix
Browse files Browse the repository at this point in the history
  • Loading branch information
UweKubosch committed Jan 11, 2023
1 parent 24beaad commit 310283d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 20 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

group 'no.datek'
version '0.0.6'
version '0.0.7'

java {
withJavadocJar()
Expand Down
28 changes: 10 additions & 18 deletions src/main/resources/ruby/controller_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/main/resources/ruby/slim_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 310283d

Please sign in to comment.