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

Function daysLeftOf

packages/shared/src/features/boost/BoostManager.tsx:275–283  ·  view source on GitHub ↗
({ endedAt }: Campaign)

Source from the content-addressed store, hash-verified

273 });
274
275const daysLeftOf = ({ endedAt }: Campaign): string => {
276 const days = getAbsoluteDifferenceInDays(new Date(endedAt), new Date());
277
278 if (days === 0) {
279 return 'Ends today';
280 }
281
282 return days === 1 ? '1 day left' : `${days} days left`;
283};
284
285/** Full at the start, emptying as the days run out. Capped under 100, where
286 * ProgressCircle swaps the ring for a check mark */

Callers 1

TimeLeftFunction · 0.85

Calls 1

Tested by

no test coverage detected