mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-02 13:12:13 +08:00
18 lines
403 B
Ruby
18 lines
403 B
Ruby
# frozen_string_literal: true
|
|
|
|
class RepositoryTimeValue < RepositoryDateTimeValueBase
|
|
def data_changed?(new_data)
|
|
new_time = Time.zone.parse(new_data)
|
|
new_time.min != data.min || new_time.hour != data.hour
|
|
end
|
|
|
|
def formatted
|
|
super(:time)
|
|
end
|
|
|
|
def self.new_with_payload(payload, attributes)
|
|
value = new(attributes)
|
|
value.data = Time.zone.parse(payload)
|
|
value
|
|
end
|
|
end
|