Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix birth date is not displayed in patients listing #97

Merged
merged 2 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Changelog
1.4.0 (unreleased)
------------------

- #97 Fix birth date is not displayed in patients listing
- #93 Layered listing searchable text adapter
- #92 Allow searches by patient in samples listing
- #91 Allow only 1 Patient per Report
Expand Down
6 changes: 4 additions & 2 deletions src/senaite/patient/browser/patientfolder.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from bika.lims.utils import get_image
from bika.lims.utils import get_link
from senaite.app.listing.view import ListingView
from senaite.core.api import dtime
from senaite.patient import messageFactory as _sp
from senaite.patient.api import to_identifier_type_name
from senaite.patient.api import tuplify_identifiers
Expand Down Expand Up @@ -193,8 +194,9 @@ def folderitem(self, obj, item, index):

# Birthdate
birthdate = obj.getBirthdate()
if birthdate:
item["birthdate"] = self.ulocalized_time(birthdate, long_format=0)
# birthdate is a datetime.date object
birthdate = dtime.to_DT(birthdate)
item["birthdate"] = dtime.to_localized_time(birthdate)

# Folder
parent = api.get_parent(obj)
Expand Down