유희정

modify setting and dbhelper

import React, { Component } from 'react';
import { View, Text, StyleSheet, TextInput, TouchableOpacity, Image } from 'react-native';
import AddButton from '../component/AddButton'
import {delete_all_data} from '../component/DBhelper'
var date = new Date();
date.setHours(date.getHours()+9);
date.setMonth(date.getMonth()+1);
export default class SettingTab extends Component {
......@@ -40,7 +40,8 @@ export default class SettingTab extends Component {
delete_id(){
this.setState({ID: ''})
//기기연결 해제, 디비비우기
save_app_data()
delete_all_data()
}
render() {
return (
......
......@@ -82,6 +82,11 @@ export function get_today_data(today){
return list;
}
export function delete_all_data(today){
let all_wastes = realm.objects('Waste');
realm.delete(all_wastes);
}
var get_date = function (date){
return pad(date.getFullyear(),4)+pad(date.getMonth()+1, 2)+ pad(date.getDate(), 2)
}
\ No newline at end of file
......