Commit 16f0516f authored by Sean Arnold's avatar Sean Arnold

Return active times in HH:MM format

parent aeea7a72
......@@ -9,13 +9,19 @@ module Types
field :from, GraphQL::STRING_TYPE,
null: true,
description: 'The start of the rotation interval.',
method: :start_time
description: 'The start of the rotation interval.'
field :to, GraphQL::STRING_TYPE,
null: true,
description: 'The end of the rotation interval.',
method: :end_time
description: 'The end of the rotation interval.'
def from
object.start_time&.strftime('%H:%M')
end
def to
object.end_time&.strftime('%H:%M')
end
end
# rubocop: enable Graphql/AuthorizeTypes
end
......
......@@ -2,8 +2,6 @@
module IncidentManagement
class OncallRotation < ApplicationRecord
include Gitlab::Utils::StrongMemoize
ActivePeriod = Struct.new(:start_time, :end_time) do
def present?
start_time && end_time
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment