0
The api has the date as follows:
"period": "2019-10-19T00:00:00.000-03:00",
Pull my flatList like this:
componentDidMount() {
console.log(this.props.navigation)
this.loadData();
}
async loadData() {
try {
let response = await axios.get(SERVERNEW + '/activities.json');
this.setState({ progr: response.data, loading: false });
console.log(response)
} catch (error) {
alert('Não foi possivel carregar os eventos');
this.setState({ loading: false });
}
}
And I address it as follows:
render(){
return this.state.loading ? (
<View>
<Spinner visible={true} textContent={'Carregando...'} />
</View>
) : (
<View style={style.programming.container}>
<ScrollView>
<View style={{marginTop: 20, marginLeft: 25}}>
<Text style={{fontSize: 20, fontWeight: 'bold', color: '#22abc6'}}>PROGRAMAÇÃO</Text>
</View>
<FlatList
style={{backgroundColor: 'white', marginTop: 10}}
data={this.state.progr}
renderItem={({item}) => this.renderItem({item})}
keyExtractor = {(item, index) => item.id.toString()}
/>
</ScrollView>
The dates of the event are 16, 17, 18 e 19... How do I render display first those of day 16, dps 17 and so on... I think I have to use the filter, but I’m not getting the syntax right. Thank you
I got it the way I put it here, but obg
– Ruan Duarte