Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
pill_minder
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Phuengton Chummuel
pill_minder
Commits
c4c99419
Commit
c4c99419
authored
Mar 21, 2018
by
Phuengton Chummuel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add generateid function
parent
4a4a8559
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
Utils.js
src/Utils.js
+12
-0
No files found.
src/Utils.js
View file @
c4c99419
...
@@ -57,4 +57,15 @@ export function appointmentNotification(message, date, id, payload) {
...
@@ -57,4 +57,15 @@ export function appointmentNotification(message, date, id, payload) {
export
function
cancleNotification
(
id
)
{
export
function
cancleNotification
(
id
)
{
PushNotification
.
cancelLocalNotifications
({
id
:
id
});
PushNotification
.
cancelLocalNotifications
({
id
:
id
});
}
export
function
generateID
()
{
let
d
=
new
Date
().
getTime
();
let
id
=
'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'
.
replace
(
/
[
xy
]
/g
,
function
(
c
)
{
let
r
=
(
d
+
Math
.
random
()
*
16
)
%
16
|
0
;
d
=
Math
.
floor
(
d
/
16
);
return
(
c
==
'x'
?
r
:
(
r
&
0x3
|
0x8
)).
toString
(
5
);
});
return
id
;
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment