(
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;
},
)
| 221 | }; |
| 222 | |
| 223 | export 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 | |
| 241 | export const getPlusMemberDateFormat = (date: string | Date): string => { |
| 242 | return new Date(date).toLocaleString('en-US', { |
no outgoing calls
no test coverage detected