File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -146,18 +146,18 @@ def to_s
146146 #
147147 # Otherwise, the timezone is set based on the difference between the current timezone offset (if any) and `zone`.
148148 #
149- # @param [String] zone (nil) In the form of {ZONE_GRAMMAR}.
149+ # @param [DayTimeDuration, String] zone (nil) In the form of {ZONE_GRAMMAR}.
150150 # @return [Temporal] `self`
151151 # @raise [RangeError] if `zone < -14*60` or `zone > 14*60`
152152 # @see https://www.w3.org/TR/xpath-functions/#func-adjust-dateTime-to-timezone
153153 def adjust_to_timezone! ( *args )
154154 zone = args . empty? ? '+00:00' : args . first
155- if zone . nil ?
155+ if zone . to_s . empty ?
156156 # Remove timezone component
157157 @object = self . class . new ( @object . strftime ( self . class . const_get ( :FORMAT ) ) ) . object
158158 @zone = nil
159159 else
160- md = zone . match ( ZONE_GRAMMAR )
160+ md = zone . to_s . match ( ZONE_GRAMMAR )
161161 raise ArgumentError ,
162162 "expected #{ zone . inspect } to be a xsd:dayTimeDuration or +/-HH:MM" unless md
163163
You can’t perform that action at this time.
0 commit comments