Skip to content

Commit

Permalink
Update Xince.py
Browse files Browse the repository at this point in the history
Updated to fix date problem
  • Loading branch information
campbellpryde authored and davidtauriello committed Sep 15, 2023
1 parent 9c3e070 commit b087efc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugin/Xince.py
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ def get_context(instance_name, contexts, taxonomy, nsmap, entity, period, dimens
period_node.append(instant_node)
if period.start.hour + period.start.minute + period.start.second + period.start.microsecond == 0:
# the time is midnight the end of day
instant_node.text = (period.start + datetime.timedelta(days=1)).date().isoformat()
instant_node.text = (period.start - datetime.timedelta(days=1)).date().isoformat()
else:
instant_node.text = period.start.isoformat()
else: # duration
Expand All @@ -891,7 +891,7 @@ def get_context(instance_name, contexts, taxonomy, nsmap, entity, period, dimens

end_node = et.Element(f'{{{_XBRLI_NAMESPACE}}}endDate')
if period.end.hour + period.end.minute + period.end.second + period.end.microsecond == 0:
end_node.text = (period.end + datetime.timedelta(days=1)).date().isoformat()
end_node.text = (period.end - datetime.timedelta(days=1)).date().isoformat()
else:
end_node.text = period.end.isoformat()
period_node.append(end_node)
Expand Down

0 comments on commit b087efc

Please sign in to comment.