Skip to content

Conversation

@cristina-stonepedraza
Copy link
Collaborator

Closes #1237

To resolve this, I specified using the UTC time for the date saved when retrieving it, and then formatted the date to YYYY-MM-DD. The date selected in the shipping form and the date displayed with shipping details now match.

@cristina-stonepedraza
Copy link
Collaborator Author

@mslarae13 Is YYYY-MM-DD the preferred date format?

@cristina-stonepedraza cristina-stonepedraza marked this pull request as ready for review November 25, 2025 17:14
Copy link
Contributor

@mslarae13 mslarae13 left a comment

Choose a reason for hiding this comment

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

YYYY-MM-DD is good
@pkalita-lbl for technical check

Copy link
Collaborator

@pkalita-lbl pkalita-lbl left a comment

Choose a reason for hiding this comment

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

Two issues:

  1. Vuetify 3 changed a lot about how its date picker component works. Because of that the format of the date in the shipping info summary is now out of sync with the format of the date in the shipping info form:
Image

The format of what's shown in the form is controlled here:

:model-value="expectedShippingDate?.toLocaleDateString()"

What I would suggest is creating a utility function that takes a date and formats it in the desired format. Then both the form and the summary can call the utility to do the formatting.

  1. To do the formatting I would recommend using the Moment.js library that is already a dependency. So the utility function for formatting might look like:
import moment from 'moment';

function formatShippingDate(date: string | Date | null) {
  if (!date) {
    return '';
  }
  return moment(date).format('YYYY-MM-DD');
}

Because the Vuetify 3 date picker uses Date objects as a model instead of a string, UTC vs local time should be handled transparently.

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.

Date is not consistent between EMSL shipping form and shipping info summary

4 participants