Skip to content

Commit

Permalink
Force obj coercion to datetime in helper
Browse files Browse the repository at this point in the history
  • Loading branch information
cycomachead committed Jul 17, 2023
1 parent dfef69a commit 5030dd2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/helpers/date_time_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def length_timestamp(length)
# * +String+ -> formated datetime object
def format_datetime(obj)
return unless obj
obj = DateTime.parse(obj) unless ob.respond_to?(:strftime)

obj.strftime('%Y-%m-%d %H:%M')
end
Expand Down

0 comments on commit 5030dd2

Please sign in to comment.