Skip to content

Commit

Permalink
Merge branch 'feature/onboarding' of https://github.com/acmucsd/membe…
Browse files Browse the repository at this point in the history
…rship-portal-ui-v2 into feature/onboarding
  • Loading branch information
SheepTester committed Sep 28, 2024
2 parents 282f5e2 + 60d1df8 commit 667d390
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,19 +183,22 @@ export function useObjectUrl(file?: Blob | null): string {
return url;
}

// Set timeZone to Pacific Time on server-side, use local time on client. Users
// will usually be in California, so this helps with hydration.
const dateFormat = new Intl.DateTimeFormat('en-US', {
month: 'short',
day: 'numeric',
hour: 'numeric',
minute: '2-digit',
timeZone: typeof window === 'undefined' ? 'America/Los_Angeles' : undefined,
});

const dateFormatWithYear = new Intl.DateTimeFormat('en-US', {
year: 'numeric',
month: 'short',
day: 'numeric',
hour: 'numeric',
minute: '2-digit',
timeZone: typeof window === 'undefined' ? 'America/Los_Angeles' : undefined,
});

export const formatDate = (date: Date | string, year?: boolean): string => {
Expand Down

0 comments on commit 667d390

Please sign in to comment.