Toggle navigation
Toggle navigation
This project
Loading...
Sign in
유희정
/
fwiot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
유희정
2019-12-14 13:09:55 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f963efab563d05257fb0daace518bc07cbb584d4
f963efab
1 parent
d9378bcb
modify setting and dbhelper
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
source/AppTabNavigator/SettingTab.js
source/component/DBhelper.js
source/AppTabNavigator/SettingTab.js
View file @
f963efa
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
(
...
...
source/component/DBhelper.js
View file @
f963efa
...
...
@@ -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
...
...
Please
register
or
login
to post a comment