Skip to content

Commit

Permalink
Remove weeks to match bsky datetime style
Browse files Browse the repository at this point in the history
  • Loading branch information
khammami committed Feb 7, 2024
1 parent cee0920 commit d230cc6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/datetime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ const relativeTimeFormat = new Intl.RelativeTimeFormat('en', {
numeric: 'auto',
});

// Array reprsenting one minute, hour, day, week, month, etc in seconds
const cutoffs = [60, 3600, 86400, 86400 * 7, 86400 * 30, 86400 * 365, Infinity];
// Array reprsenting one minute, hour, day, *week, month, etc in seconds
const cutoffs = [60, 3600, 86400, 86400 * 30, 86400 * 365, Infinity];

// Array equivalent to the above but in the string representation of the units
const units: Intl.RelativeTimeFormatUnit[] = ["second", "minute", "hour", "day", "week", "month", "year"];
const units: Intl.RelativeTimeFormatUnit[] = ["second", "minute", "hour", "day", "month", "year"];

export function getRelativeDateString(date: Date): string {
// Allow dates or times to be passed
Expand Down

0 comments on commit d230cc6

Please sign in to comment.