MCPcopy Create free account
hub / github.com/dailydotdev/apps / postUpdatedDateFormat

Function postUpdatedDateFormat

packages/shared/src/lib/dateFormat.ts:139–151  ·  view source on GitHub ↗
(
  value: Date | number | string,
  now = new Date(),
)

Source from the content-addressed store, hash-verified

137}
138
139export function postUpdatedDateFormat(
140 value: Date | number | string,
141 now = new Date(),
142): string {
143 const date = new Date(value);
144
145 if (isSameDay(date, now) || isSameDay(date, subDays(now, 1))) {
146 const relative = publishTimeRelativeShort(value, now);
147 return relative === 'now' ? relative : `${relative} ago`;
148 }
149
150 return postDateFormat(value, now);
151}
152
153export function commentDateFormat(
154 value: Date | number | string,

Callers 1

formatDateFunction · 0.85

Calls 2

publishTimeRelativeShortFunction · 0.85
postDateFormatFunction · 0.85

Tested by

no test coverage detected