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: make the lastUpdatedDate consistent on LPR #1385

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jajjibhai008
Copy link
Contributor

@jajjibhai008 jajjibhai008 commented Jan 17, 2025

Description
JIRA-> ENT-9927

For all changes

  • Ensure adequate tests are in place (or reviewed existing tests cover changes)

Only if submitting a visual change

  • Ensure to attach screenshots
  • Ensure to have UX team confirm screenshots

src/utils.js Outdated Show resolved Hide resolved
@jajjibhai008 jajjibhai008 force-pushed the eahmadjaved/fix-lpr-date branch from ceb2212 to b6b6f5b Compare January 21, 2025 09:37
Copy link

codecov bot commented Jan 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.90%. Comparing base (fdb32f2) to head (5aef0e3).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1385      +/-   ##
==========================================
- Coverage   85.90%   85.90%   -0.01%     
==========================================
  Files         627      627              
  Lines       13705    13703       -2     
  Branches     2831     2867      +36     
==========================================
- Hits        11773    11771       -2     
  Misses       1863     1863              
  Partials       69       69              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

const options = { year: 'numeric', month: 'long', day: 'numeric' };
return new Date(dateString).toLocaleDateString(undefined, options);
};
const defaultDataUpdatedDate = new Date().toISOString();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[question/clarification] Can you help me understand the interaction between the existing currentDate and the added defaultDataUpdatedDate? Is it intended to continue using currentDate variable in various places throughout this component? Should we be using only one or the other, since they are largely both representing the same thing (the current timestamp)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, currentDate does not include a timestamp, which is used in other places. That's why I created a separate variable, defaultDataUpdatedDate, which includes the timestamp. Adding the timestamp ensures consistency with LPR dates. By the way, there is a very low chance that data?.lastUpdatedAt will not be provided by the backend—it is almost always present. Therefore, defaultDataUpdatedDate serves as a safety check.

@jajjibhai008 jajjibhai008 force-pushed the eahmadjaved/fix-lpr-date branch from b6b6f5b to 5aef0e3 Compare January 24, 2025 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants