fix(date formatting): Show study date as a fallback for an empty series date and show 'No Study Date' as a back up for both (#3483)

This commit is contained in:
Joe Boccanfuso authored and GitHub committed 2023-06-29 10:43:56 -04:00
1 parent fa37593696
commit 15ad8f29cd
4 files changed
+11 -4

No files matched your search

+2 -1
View File
@@ -8,5 +8,6 @@ import moment from 'moment';
* @returns {string} Formatted date
*/
export default (date, format = 'DD-MMM-YYYY') => {
return moment(date).format(format);
// moment(undefined) returns the current date, so return the empty string instead
return date ? moment(date).format(format) : '';
};