Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cordova-plugin-local-notifications
Overview
Overview
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
Nabil Sadki
cordova-plugin-local-notifications
Commits
e134975c
Commit
e134975c
authored
Nov 03, 2017
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support weekday and weekOfMonth matchers on Android
parent
d93534ba
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
Request.java
src/android/notification/Request.java
+21
-2
MatchTrigger.java
src/android/notification/trigger/MatchTrigger.java
+0
-0
No files found.
src/android/notification/Request.java
View file @
e134975c
...
...
@@ -151,7 +151,10 @@ public final class Request {
Object
every
=
spec
.
opt
(
"every"
);
if
(
every
instanceof
JSONObject
)
{
return
new
MatchTrigger
(
getDateMatchingComponents
());
List
<
Integer
>
cmp1
=
getMatchingComponents
();
List
<
Integer
>
cmp2
=
getSpecialMatchingComponents
();
return
new
MatchTrigger
(
cmp1
,
cmp2
);
}
Unit
unit
=
getUnit
();
...
...
@@ -205,7 +208,7 @@ public final class Request {
*
* @return [min, hour, day, month, year]
*/
private
List
<
Integer
>
get
Date
MatchingComponents
()
{
private
List
<
Integer
>
getMatchingComponents
()
{
JSONObject
every
=
spec
.
optJSONObject
(
"every"
);
return
Arrays
.
asList
(
...
...
@@ -218,6 +221,22 @@ public final class Request {
}
/**
* Gets an array of all date parts to construct a datetime instance.
*
* @return [min, hour, day, month, year]
*/
private
List
<
Integer
>
getSpecialMatchingComponents
()
{
JSONObject
every
=
spec
.
optJSONObject
(
"every"
);
return
Arrays
.
asList
(
(
Integer
)
every
.
opt
(
"weekday"
),
(
Integer
)
every
.
opt
(
"weekdayOrdinal"
),
(
Integer
)
every
.
opt
(
"weekOfMonth"
),
(
Integer
)
every
.
opt
(
"quarter"
)
);
}
/**
* Gets the base date from where to calculate the next trigger date.
*/
private
Date
getBaseDate
()
{
...
...
src/android/notification/trigger/MatchTrigger.java
View file @
e134975c
This diff is collapsed.
Click to expand it.
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