Updating the way true expiration date is calculated
RELATED ISSUES
N/A. I would consider this as a enhancement, but there is no enhancement template yet, so I didn't make a issue for this.
DEPENDANTS
Depends on 1 merge request being merged: !218 (merged)
DESCRIPTION
Fixing the way true expiration date is calculated so that it is calculated using the Calendar
class instead of manually trying to calculate the date. This helps keep the code clean, easy to understand, and helps prevent any calculation errors.
This merge request also includes some extra enhancements for DisplayTrueExpirationFragment
:
- General layout clean-up/organization
- "Printed Expiration Date" label
- "Shelf Life" label
- "Storage Type" label
- "Storage Tips" label
STEPS TO TEST
- Go to the 'Check Expiration Date' feature within the app.
- Scan or enter a barcode.
- Fill in the required information if in
SelectItemFragment
, or press confirm if inConfirmItemFragment
. - Select a random date.
- Press 'Accept'.
Confirm that the date is still being properly calculated.
[Printed expiration date] + [Min/max of the shelf life's metric] = [True expiration date]
NOTES
- Merged branch
issue_220_printed_expiration_date
from MR !218 (merged) into this branch. - Converted
DisplayTrueExpirationFragment
to useCalander
class instead of hard coding the true expiration date calculation. - Added log statement.
- Updated
DisplayTrueExpirationFragment
and its layout to include printed-expiration-date, storage-type, and storage-tips labels. - Removed unnecessary "Display True Expiration Date" button from
DisplayTrueExpurationFragment
- "Storage Tips" label will display "N/A" if there is no storage tips for the current item.
- Added a "Shelf Life" label that displays the range and metric of the item's shelf life.
- Updated "True Expiration Date" to show the range of expiration instead of just the max.
RELEVANT SCREENSHOTS
Here is a screenshot of the new DisplayTrueExiprationFragment layout with Dough selected as the product:
LABELS
NEST
component:check-expiration-date
type::enhancement
status::done