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 off by one date selection issue #7394

Merged
merged 3 commits into from
Mar 24, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update formatter to be more explicit about year month and day format …
…style
  • Loading branch information
gwyneplaine committed Mar 24, 2022
commit efbde0b7a3e100f36628c5d517ac881d33d86b88
4 changes: 3 additions & 1 deletion design-system/packages/fields/src/utils/dateFormatters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ export const formatDateType = (date: Date): DateType => {

// undefined means we'll use the user's locale
const formatter = new Intl.DateTimeFormat(undefined, {
dateStyle: 'short',
year: 'numeric',
month: '2-digit',
day: '2-digit',
});

export const formatDate = (date: Date): string => formatter.format(date);
Expand Down