|
|
|
@ -84,6 +84,13 @@ class Redmine::I18nTest < ActiveSupport::TestCase |
|
|
|
|
assert_equal '15:45', format_time(now, false) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
with_settings time_format: '%H %M' do |
|
|
|
|
with_settings date_format: '%d %m %Y' do |
|
|
|
|
assert_equal now.strftime('%d %m %Y %H %M'), format_time(now) |
|
|
|
|
assert_equal now.strftime('%H %M'), format_time(now, false) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def test_time_format_default |
|
|
|
@ -102,17 +109,6 @@ class Redmine::I18nTest < ActiveSupport::TestCase |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def test_time_format |
|
|
|
|
set_language_if_valid 'en' |
|
|
|
|
now = Time.now |
|
|
|
|
with_settings :time_format => '%H %M' do |
|
|
|
|
with_settings :date_format => '%d %m %Y' do |
|
|
|
|
assert_equal now.strftime('%d %m %Y %H %M'), format_time(now) |
|
|
|
|
assert_equal now.strftime('%H %M'), format_time(now, false) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def test_utc_time_format |
|
|
|
|
set_language_if_valid 'en' |
|
|
|
|
now = Time.now |
|
|
|
|