Sha256: 67830f51fb82764a11e60d22d65f9bef27d4d4598b2d4e70e0ee962af0072950
Contents?: true
Size: 566 Bytes
Versions: 5
Compression:
Stored size: 566 Bytes
Contents
# frozen_string_literal: true # require 'activesupport/time' module ActiveSupport class TimeWithZone def to_s(format = :default) if format == :db utc.to_s(format) elsif formatter = ::Time::DATE_FORMATS[format] # rubocop:disable Lint/AssignmentInCondition formatter.respond_to?(:call) ? formatter.call(self).to_s : strftime(formatter) else # "#{time.strftime("%Y-%m-%d %H:%M:%S")} #{formatted_offset(false, 'UTC')}" # mimicking Ruby Time#to_s format time.strftime('%d/%m/%Y %H:%M') end end end end
Version data entries
5 entries across 5 versions & 1 rubygems