/* eslint-disable prettier/prettier */
import { Component } from 'react';
import moment from 'moment';
import AsyncStorage from '@react-native-async-storage/async-storage';
const date = moment().utcOffset('+08:00').format('D MMM');
const time = moment().utcOffset('+08:00').format('h:mm a');
const day = moment().utcOffset('+08:00').format('ddd');
//var records = [];

class OtherClass extends Component {
  saveRecord = async (correct, wrong, stime) => {
    let obj = {
      correct: correct,
      wrong: wrong,
      timer: stime,
      date: date,
      time: time,
      day : day,
    };

       try {
    const value = await AsyncStorage.getItem('@storage_key');
    if (value !== null) {
        // We have data!!
       // console.log(JSON.parse(value));
         this.setState({ logbook: JSON.parse(value) });
           console.log(this.state.logbook.length);

    }
} catch (error) {
    // Error retrieving data
}

  };
}

export default OtherClass;
