-
-
Notifications
You must be signed in to change notification settings - Fork 8
Release 1.55.0 to master #596
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
Changes from all commits
25b5662
327428d
eb50f39
2fe6353
c55e633
7e1d542
51f7498
e540a74
1d668cf
cf114bb
3b9bcb6
f984e8d
041ffa6
f21345e
7ba989c
47bbc51
2de539d
a3b0018
b54f671
ceed6a0
e8ba399
e9e9465
adbec6c
7daa0bc
6d56228
559fe0e
62e6456
ddf81a0
ef4917e
f29cd19
dabe132
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -166,7 +166,9 @@ export function formatDiagnosisDate(patient) { | |
| * formatDateRange | ||
| * @param {String|Date} startDate - A moment-compatible date object or string | ||
| * @param {String|Date} endDate - A moment-compatible date object or string | ||
| * @param {String} format - Optional. The moment format string to parse startDate and endDate with | ||
| * @param {String} dateParseFormat - Optional. The moment format string to parse startDate and endDate with | ||
| * | ||
| * @return {String} formatted date range for display | ||
| */ | ||
| export function formatDateRange(startDate, endDate, dateParseFormat, monthFormat = 'MMM') { | ||
| const start = moment.utc(startDate, dateParseFormat); | ||
|
|
@@ -182,6 +184,36 @@ export function formatDateRange(startDate, endDate, dateParseFormat, monthFormat | |
| return formattedRange; | ||
| } | ||
|
|
||
| export const CHART_DATE_BOUND_FORMAT = { | ||
| DATE_AND_TIME: 'MMM D, YYYY (h:mm A)', | ||
| DATE_ONLY: 'MMM D, YYYY', | ||
| }; | ||
|
|
||
| /** | ||
| * getChartDateBoundFormat | ||
| * @param {Object} startDate - a moment time object | ||
| * @param {Object} endDate - a moment time object | ||
| * | ||
| * @return {String} a moment time format (e.g 'MMM D, YYYY') | ||
| */ | ||
| export function getChartDateBoundFormat(startDate, endDate) { | ||
| if (!endDate) return CHART_DATE_BOUND_FORMAT.DATE_ONLY; | ||
|
|
||
| const isStartDateMidnight = (startDate?.hours() === 0 && startDate?.minutes() === 0) || | ||
| (startDate?.hours() === 23 && startDate?.minutes() >= 59); | ||
|
|
||
| const isEndDateMidnight = (endDate?.hours() === 0 && endDate?.minutes() === 0) || | ||
| (endDate?.hours() === 23 && endDate?.minutes() >= 59); | ||
|
|
||
| const isMatchingDateBounds = isStartDateMidnight && isEndDateMidnight; | ||
|
|
||
| if (!isMatchingDateBounds) { | ||
| return CHART_DATE_BOUND_FORMAT.DATE_AND_TIME; | ||
| } | ||
|
|
||
| return CHART_DATE_BOUND_FORMAT.DATE_ONLY; | ||
| } | ||
|
Comment on lines
+187
to
+215
|
||
|
|
||
| /** | ||
| * formatDuration | ||
| * @param {Number} duration - positive integer duration in milliseconds | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clock-drift tolerance is only applied when filtering
pumpSettingsForUploadfrompumpSettingsDatumsByIdMap, but the later fallback tothis.latestDatumByType.pumpSettingsstill requirescandidate.time <= latestPumpUpload.timefor non-continuous uploads. This can still exclude a valid pumpSettings datum that’s within the 15-minute tolerance window when the by-id map doesn’t yield a match. Consider reusing the same tolerance check for the fallback path as well (and ideally hoist the tolerance constant so it’s not duplicated).