Skip to content

Commit

Permalink
Refactor class_timePeriod.rb for improved date handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jwaspin committed Jul 1, 2024
1 parent 17cbe18 commit 763bca2
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ def writeXML(hPeriod)
# if empty add indeterminatePosition="unknown"
unless hPeriod[:startDateTime].empty?
hDateTime = hPeriod[:startDateTime]
dateTime = hDateTime[:dateTime]
timeResolution = hDateTime[:dateResolution]
dateStr = AdiwgDateTimeFun.stringDateTimeFromDateTime(dateTime, timeResolution)
dateStr = AdiwgDateTimeFun.stringDateTimeFromDateObject(hDateTime)
@xml.tag!('gml:beginPosition', dateStr)
end
if hPeriod[:startDateTime].empty?
Expand All @@ -79,9 +77,7 @@ def writeXML(hPeriod)
# if empty add indeterminatePosition="unknown"
unless hPeriod[:endDateTime].empty?
hDateTime = hPeriod[:endDateTime]
dateTime = hDateTime[:dateTime]
timeResolution = hDateTime[:dateResolution]
dateStr = AdiwgDateTimeFun.stringDateTimeFromDateTime(dateTime, timeResolution)
dateStr = AdiwgDateTimeFun.stringDateTimeFromDateObject(hDateTime)
@xml.tag!('gml:endPosition', dateStr)
end
if hPeriod[:endDateTime].empty?
Expand Down

0 comments on commit 763bca2

Please sign in to comment.