Bluesky app fork with some witchin' additions 馃挮

add dot separated time style (#9455)

authored by samuel.fm and committed by

GitHub 0ba4edab 1eacf427

+13 -3
+11 -1
src/lib/strings/time.ts
··· 1 1 import {type I18n} from '@lingui/core' 2 + import {msg} from '@lingui/macro' 2 3 3 4 export function niceDate( 4 5 i18n: I18n, 5 6 date: number | string | Date, 6 - dateStyle: 'short' | 'medium' | 'long' | 'full' = 'long', 7 + dateStyle: 'short' | 'medium' | 'long' | 'full' | 'dot separated' = 'long', 7 8 ) { 8 9 const d = new Date(date) 10 + 11 + if (dateStyle === 'dot separated') { 12 + return i18n._( 13 + msg({ 14 + context: 'date and time formatted like this: [time] 路 [date]', 15 + message: `${i18n.date(d, {timeStyle: 'short'})} 路 ${i18n.date(d, {day: 'numeric', month: 'numeric', year: '2-digit'})}`, 16 + }), 17 + ) 18 + } 9 19 10 20 return i18n.date(d, { 11 21 dateStyle,
+2 -2
src/screens/PostThread/components/ThreadItemAnchor.tsx
··· 570 570 <BackdatedPostIndicator post={post} /> 571 571 <View style={[a.flex_row, a.align_center, a.flex_wrap, a.gap_sm]}> 572 572 <Text style={[a.text_sm, t.atoms.text_contrast_medium]}> 573 - {niceDate(i18n, post.indexedAt, 'medium')} 573 + {niceDate(i18n, post.indexedAt, 'dot separated')} 574 574 </Text> 575 575 {isRootPost && ( 576 576 <WhoCanReply post={post} isThreadAuthor={isThreadAuthor} /> ··· 655 655 a.leading_tight, 656 656 t.atoms.text_contrast_medium, 657 657 ]}> 658 - <Trans>Archived from {niceDate(i18n, createdAt)}</Trans> 658 + <Trans>Archived from {niceDate(i18n, createdAt, 'medium')}</Trans> 659 659 </Text> 660 660 </View> 661 661 )}