cocina_display 1.4.1 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/cocina_display/concerns/events.rb +5 -10
- data/lib/cocina_display/dates/date.rb +6 -0
- data/lib/cocina_display/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f91655b5e875b9fe1be7449bc1ba5cca1034e8b811a38444510dffc08e05cfbe
|
|
4
|
+
data.tar.gz: 58b7286e58890a2bbc769fcc7de8a18aebc1f44108123b4cfb3cec4069e2cc3d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dc64eef19cc55375a71eaa27aacbd84c068155b5d36d2a019515f4a8a74ffe22aae82375e5f2ae2dc5cad2a4201b718cc1cc2e5796e1278c95ab1bd6149177f2
|
|
7
|
+
data.tar.gz: e64de6a2785f71535b4854dd9eff74da93085d3c658bfd039586c027ba1e88b2beff0310e28d7a9bd68a6766bb9b4bfb202ad21a4512c1d21b3869f802ba9ba8
|
|
@@ -9,21 +9,16 @@ module CocinaDisplay
|
|
|
9
9
|
# @return [Date, nil]
|
|
10
10
|
# @see https://github.com/inukshuk/edtf-ruby
|
|
11
11
|
def pub_date_edtf(ignore_qualified: false)
|
|
12
|
-
date = pub_date(ignore_qualified: ignore_qualified)
|
|
13
|
-
return unless date
|
|
12
|
+
return unless (date = pub_date(ignore_qualified: ignore_qualified))
|
|
14
13
|
|
|
15
14
|
if date.is_a? CocinaDisplay::Dates::DateRange
|
|
16
|
-
date = date.start
|
|
15
|
+
date = date.start&.known? ? date.start : date.stop
|
|
17
16
|
end
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
return
|
|
18
|
+
return unless date&.known?
|
|
19
|
+
return date.date.from if date.date.is_a?(EDTF::Interval)
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
edtf_date.from
|
|
24
|
-
else
|
|
25
|
-
edtf_date
|
|
26
|
-
end
|
|
21
|
+
date.date
|
|
27
22
|
end
|
|
28
23
|
|
|
29
24
|
# The earliest preferred publication year as an integer.
|
|
@@ -143,6 +143,12 @@ module CocinaDisplay
|
|
|
143
143
|
qualifier.present?
|
|
144
144
|
end
|
|
145
145
|
|
|
146
|
+
# Does this represent a known date?
|
|
147
|
+
# @return [Boolean]
|
|
148
|
+
def known?
|
|
149
|
+
!date.is_a?(EDTF::Unknown)
|
|
150
|
+
end
|
|
151
|
+
|
|
146
152
|
# Was an encoding declared for this date?
|
|
147
153
|
# @return [Boolean]
|
|
148
154
|
def encoding?
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cocina_display
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.4.
|
|
4
|
+
version: 1.4.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nick Budak
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-10-
|
|
11
|
+
date: 2025-10-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: janeway-jsonpath
|