Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

249
Views
how to show json data by date in react native

i have json data by dates i want to show schedule time for today. how can this be implemented? json file address https://volnaveri.by/tt.json

react native code

   import React, { Component } from 'react';
import { ActivityIndicator, FlatList, Text, View } from 'react-native';

export default class App extends Component {
  constructor(props) {
    super(props);

    this.state = {
      data: [],
      isLoading: true
    };
  }

  async getMovies() {
    try {
      const response = await fetch('https://volnaveri.by/tt.json');
      const json = await response.json();
      this.setState({ data: json.times });
    } catch (error) {
      console.log(error);
    } finally {
      this.setState({ isLoading: false });
    }
  }

  componentDidMount() {
    this.getMovies();
  }

  render() {
    const { data, isLoading } = this.state;

    return (
      <View style={{ flex: 1, padding: 24 }}>
        {isLoading ? <ActivityIndicator/> : (
          <FlatList
            data={data}
            keyExtractor={({ id }, index) => id}
            renderItem={({ item }) => (
              <Text>{item.Date}, {item.Monday}, {item.Tuesday}, {item.Monday}, {item.Wednesday}, {item.Thursday}</Text>
            )}
          />
        )}
      </View>
    );
  }
};

so far this is what i got. photo

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Instead of this.setState({ data: json.times });

To do:

this.setState({ data: [data.times.find(time => time.Date.split('-')[2] === new Date().getDate()))]

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!