ffi-icu 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 357d3d218075dcfd56e963cd261c5fbe947d8daeb5d5826aebce8f1bedfe7ffe
4
- data.tar.gz: afb2c28c1730cf05652433a1a721447385de47fa0fd105cb9782fe7496c55d65
3
+ metadata.gz: e05cacd8501af573e102abe908556c1ea0f2eb1990b560271890c9d0827feb09
4
+ data.tar.gz: 4c5433c4183b376548f20ff533311d1acc61035d395b63a35f8e89a387ca7d98
5
5
  SHA512:
6
- metadata.gz: a257ab16df440695f42f6db486950e62fa1c08655324ad59d347eeb0e02d46c37581f04845cf035c528c7223a8e3d092a9bac877f7da5da10daee18e701d9aa3
7
- data.tar.gz: be241d1659c60288c84f7844efaec71d368c1c650b4c1be410cbb0ff99cf6f08f468af30fd02a5ac050d853b18e243250dcc199c81815a5d2f7b1bf9bd783559
6
+ metadata.gz: a40fa82617a2c16aa759b263e5153e4135b5844823666ac5d0b5d205b300819f3ac1cf10d5e8e9f9182c2357080e6ed6add40388287b308ef6eae645f052a38f
7
+ data.tar.gz: 4d34feb23961b844cc9701d09a52a806f375bc58b10a04622d2230d57a1a97cd015f004ed72239a039041e901d304deb4051f81400191981116b7b055ef8b15b
@@ -254,7 +254,10 @@ module ICU
254
254
 
255
255
  # Either ensure the skeleton has, or does not have, am/pm, as appropriate
256
256
  if ['h11', 'h12'].include?(@hour_cycle)
257
- skeleton_str << 'a' unless skeleton_str.include? 'a'
257
+ # Only actually append 'am/pm' if there is an hour in the format string
258
+ if skeleton_str =~ /[hHkKjJ]/ && !skeleton_str.include?('a')
259
+ skeleton_str << 'a'
260
+ end
258
261
  else
259
262
  skeleton_str.gsub!('a', '')
260
263
  end
@@ -1,3 +1,3 @@
1
1
  module ICU
2
- VERSION = "0.4.2"
2
+ VERSION = "0.4.3"
3
3
  end
data/spec/time_spec.rb CHANGED
@@ -128,6 +128,12 @@ module ICU
128
128
  expect(str).to_not match(/(am|pm)/i)
129
129
  end
130
130
 
131
+ it 'does not include am/pm if time is not requested' do
132
+ t = Time.new(2021, 04, 01, 00, 05, 0, "+00:00")
133
+ str = TimeFormatting.format(t, time: :none, date: :short, locale: locale_name, zone: 'UTC', hour_cycle: 'h12')
134
+ expect(str).to_not match(/(am|pm|下午|上午)/i)
135
+ end
136
+
131
137
  context '@hours keyword' do
132
138
  before(:each) do
133
139
  skip("Only works on ICU >= 67") if Lib.version.to_a[0] < 67
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffi-icu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jari Bakken