Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

replace getDate with toIsoString().slice(0,10) (#3792)

authored by

Samuel Newman and committed by
GitHub
a6061489 80a1687d

+8 -4
+8 -4
src/screens/Messages/Conversation/MessageItem.tsx
··· 108 108 109 109 const diff = now.getTime() - date.getTime() 110 110 111 - // under 1 minute 111 + // if under 1 minute 112 112 if (diff < 1000 * 60) { 113 113 return _(msg`Now`) 114 114 } 115 115 116 - // in the last day 117 - if (now.getDate() === date.getDate()) { 116 + // if in the last day 117 + if (now.toISOString().slice(0, 10) === date.toISOString().slice(0, 10)) { 118 118 return time 119 119 } 120 120 121 121 // if yesterday 122 - if (diff < 24 * 60 * 60 * 1000 && now.getDate() - date.getDate() === 1) { 122 + const yesterday = new Date(now) 123 + yesterday.setDate(yesterday.getDate() - 1) 124 + if ( 125 + yesterday.toISOString().slice(0, 10) === date.toISOString().slice(0, 10) 126 + ) { 123 127 return _(msg`Yesterday, ${time}`) 124 128 } 125 129