Part 6 - Fetch rss feed and Test Driven Development on Helpers functions

preview_player
Показать описание


I would like to thank the donators to this channel. Thank you so much :)

- Wonmin Jeon
- iMarket
- Tarek Fattah
- Donald Walters
- Ara Juljulian
- ghanim aldousery
- Nacho Valera
- KarDo Qadir
- Matteo Pennisi

Рекомендации по теме
Комментарии
Автор

Quite a few of the item descriptions have unwanted HTML tags within the string. Simply refactor your renderItem prop within your <FlatList /> in PodcastDetailsScreens.tsx as follows...

renderItem={({item}) => (
<Box px="xs">
<Text size="xs" color="grey">
{getWeekDay(new
</Text>
<Text bold>{item.title}</Text>
<Text size="sm" color="grey" numberOfLines={2}>
{item.description
.replace(/<[^>]*>/g, ' ')
.replace(/\s{2, }/g, ' ')
.trim()}
</Text>
<Text size="sm" color="grey">

</Text>
</Box>
)}

wij
Автор

An easier way to get the day is like this:
export enum WeekDayEnum {
Sunday = 'Sunday',
Monday = 'Monday',
Tuesday = 'Tuesday',
Wednesday = 'Wednesday',
Thursday = 'Thursday',
Friday = 'Friday',
Saturday = 'Saturday',
}

export const getWeekDay = (date: Date): WeekDayEnum => {
const day = date.getDay();

return
};

dani
Автор

Hey, I don't use TypeScript in my project, So how can i handle `enum` in dateTimeHelper js file - #12:33 ?
-
And another thing if the podcast has a duration 00:54:23 it's expected 0hrs 54min, is there a way to remove 0hrs and just return the 54min?
Thanks

Alex-pysz