content_block_tools 1.9.0 → 1.9.1
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e50657a9e305421a79ca23cd7720452747b391c2e9fddb3161f2f54f4edf1bc2
|
|
4
|
+
data.tar.gz: c0b154b766abdc488a3ce96bcffaadb7fd7a2218e0b8f5017965ae563f9068f6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cf33728eec2476f0187debb97ea2b3e752bcc6c822d4489527459bc8c51d84ae3ab1cd800c6bc31bbab565b04dcbd1c44f2dce61483a60a27efb81de99156c8c
|
|
7
|
+
data.tar.gz: a8406089740ab6c854fd9d7b73f00d9293ff12e09aea269de8fa249d2c0d94e3f4405fe06a67f0810f770b51a98cee287a81ab4c6266801895a7f7fc4c11e432
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
module ContentBlockTools
|
|
2
|
+
module Presenters
|
|
3
|
+
module FieldPresenters
|
|
4
|
+
module TimePeriod
|
|
5
|
+
class TimePresenter < BasePresenter
|
|
6
|
+
def render
|
|
7
|
+
time = Time.parse(field)
|
|
8
|
+
hour = time.strftime("%H")
|
|
9
|
+
minute = time.strftime("%M")
|
|
10
|
+
|
|
11
|
+
if minute == "00"
|
|
12
|
+
return "midday" if hour == "12"
|
|
13
|
+
return "midnight" if hour == "00"
|
|
14
|
+
|
|
15
|
+
return time.strftime("%l%P").strip
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
time.strftime("%l:%M%P").strip
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
data/lib/content_block_tools.rb
CHANGED
|
@@ -11,6 +11,7 @@ require "content_block_tools/helpers/override_classes"
|
|
|
11
11
|
require "content_block_tools/presenters/field_presenters/base_presenter"
|
|
12
12
|
require "content_block_tools/presenters/field_presenters/contact/email_presenter"
|
|
13
13
|
require "content_block_tools/presenters/field_presenters/time_period/date_presenter"
|
|
14
|
+
require "content_block_tools/presenters/field_presenters/time_period/time_presenter"
|
|
14
15
|
|
|
15
16
|
require "content_block_tools/content_block"
|
|
16
17
|
require "content_block_tools/content_block_reference"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: content_block_tools
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.9.
|
|
4
|
+
version: 1.9.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- GOV.UK Dev
|
|
@@ -195,6 +195,7 @@ files:
|
|
|
195
195
|
- lib/content_block_tools/presenters/field_presenters/base_presenter.rb
|
|
196
196
|
- lib/content_block_tools/presenters/field_presenters/contact/email_presenter.rb
|
|
197
197
|
- lib/content_block_tools/presenters/field_presenters/time_period/date_presenter.rb
|
|
198
|
+
- lib/content_block_tools/presenters/field_presenters/time_period/time_presenter.rb
|
|
198
199
|
- lib/content_block_tools/version.rb
|
|
199
200
|
- node_modules/govuk-frontend/README.md
|
|
200
201
|
- node_modules/govuk-frontend/dist/govuk-prototype-kit/functions.js
|
|
@@ -1062,7 +1063,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
1062
1063
|
- !ruby/object:Gem::Version
|
|
1063
1064
|
version: '0'
|
|
1064
1065
|
requirements: []
|
|
1065
|
-
rubygems_version: 4.0.
|
|
1066
|
+
rubygems_version: 4.0.7
|
|
1066
1067
|
specification_version: 4
|
|
1067
1068
|
summary: A suite of tools for working with GOV.UK Content Blocks
|
|
1068
1069
|
test_files: []
|