From e6c0c7aa14481763d159de682f6d5b966676d0ab Mon Sep 17 00:00:00 2001 From: dzonidoo Date: Thu, 7 Dec 2023 15:51:50 +0100 Subject: [PATCH] changes after review --- assets/wire/components/fields/ExpiryDateLabel.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/assets/wire/components/fields/ExpiryDateLabel.tsx b/assets/wire/components/fields/ExpiryDateLabel.tsx index 06605d34f..dac139217 100644 --- a/assets/wire/components/fields/ExpiryDateLabel.tsx +++ b/assets/wire/components/fields/ExpiryDateLabel.tsx @@ -1,15 +1,14 @@ import React from 'react'; import PropTypes from 'prop-types'; -import {gettext} from 'utils'; -import {get} from 'lodash'; +import {gettext, formatDate} from 'utils'; export function ExpiryDateLabel ({item, filterGroupLabels}: any) { if (item.expiry == null) { return null; } - const label = get(filterGroupLabels, 'expiry', gettext('Expiry Date')); - const value = item.expiry; + const label = filterGroupLabels?.expiry ?? gettext('Expiry Date'); + const value = formatDate(item.expiry); const text = label + ': ' + value; return (