Skip to content

Commit

Permalink
helpers: fix + new method - release
Browse files Browse the repository at this point in the history
  • Loading branch information
bcrickboom committed Jun 13, 2024
1 parent 74c9cf1 commit cfa3eb0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
8 changes: 7 additions & 1 deletion orthanc_api_client/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@ def to_dicom_date(date: Union[datetime.date, datetime.datetime]) -> str:
return '{0:4}{1:02}{2:02}'.format(date.year, date.month, date.day)

def to_dicom_time(dt: datetime.datetime) -> str:
return '{0:2}{1:02}{2:02}'.format(dt.hour, dt.minute, dt.second)
return '{0:02}{1:02}{2:02}'.format(dt.hour, dt.minute, dt.second)

def to_dicom_time_from_seconds(seconds: int) -> str:
hours = seconds // 3600
minutes = (seconds % 3600) // 60
seconds = seconds % 60
return to_dicom_time(datetime.datetime.today().replace(hour=hours, minute=minutes, second=seconds))

def from_dicom_date(dicom_date: str) -> datetime.date:
if dicom_date is None or len(dicom_date) == 0:
Expand Down
7 changes: 7 additions & 0 deletions release-notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
v 0.15.2
========

- Fix `to_dicom_time` method in Helpers
- Added `to_dicom_time_from_seconds` method in Helpers


v 0.15.1
========

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# For a discussion on single-sourcing the version across setup.py and the
# project code, see
# https://packaging.python.org/guides/single-sourcing-package-version/
version='0.15.1', # Required
version='0.15.2', # Required

# This is a one-line description or tagline of what your project does. This
# corresponds to the "Summary" metadata field:
Expand Down

0 comments on commit cfa3eb0

Please sign in to comment.