Skip to content

Commit

Permalink
attempt to remove string to time conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
ulferts committed Sep 23, 2024
1 parent db1e9f3 commit ff45d0d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib_static/redmine/i18n.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def link_regex
# Formats the given time as a date string according to the user's time zone and
# optional specified format.
#
# @param time [Time, String] The time to format. Can be a Time object or a String.
# @param time [Time] The time to format.
# @param format [String, nil] The strftime format to use for the date. If nil, the default
# date format from `Setting.date_format` is used.
# @return [String, nil] The formatted date string, or nil if the time is not provided.
Expand All @@ -136,8 +136,7 @@ def format_time_as_date(time, format: nil)
# Formats the given time as a time string according to the user's time zone
# and optional specified format.
#
# @param time [Time, String] The time to format. Can be a Time object or a
# String.
# @param time [Time] The time to format.
# @param include_date [Boolean] Whether to include the date in the formatted
# output. Defaults to true.
# @param format [String] The strftime format to use for the time. Defaults
Expand All @@ -147,7 +146,6 @@ def format_time_as_date(time, format: nil)
def format_time(time, include_date: true, format: Setting.time_format)
return nil unless time

time = time.to_time if time.is_a?(String)
zone = User.current.time_zone
local = time.in_time_zone(zone)

Expand Down

0 comments on commit ff45d0d

Please sign in to comment.