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

Function getTopReaderBadgeDateFormat

packages/shared/src/lib/dateFormat.ts:223–239  ·  view source on GitHub ↗
(
  date: string | Date,
  options?: {
    /**
     * Format on the UTC calendar rather than the viewer's. For a month that
     * was cut in UTC — a monthly ranking period, say — the local calendar
     * shifts the label by a month for anyone far enough east or west.
     */
    utc?: boolean;
  },
)

Source from the content-addressed store, hash-verified

221};
222
223export const getTopReaderBadgeDateFormat = (
224 date: string | Date,
225 options?: {
226 /**
227 * Format on the UTC calendar rather than the viewer's. For a month that
228 * was cut in UTC — a monthly ranking period, say — the local calendar
229 * shifts the label by a month for anyone far enough east or west.
230 */
231 utc?: boolean;
232 },
233): string => {
234 return new Date(date).toLocaleString('en-US', {
235 year: 'numeric',
236 month: 'long',
237 ...(options?.utc && { timeZone: 'UTC' }),
238 });
239};
240
241export const getPlusMemberDateFormat = (date: string | Date): string => {
242 return new Date(date).toLocaleString('en-US', {

Callers 2

achievementPeriodLabelFunction · 0.90
formatDateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected