Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
opening-hours
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
regionalkauf
opening-hours
Commits
74ec9bc5
Commit
74ec9bc5
authored
Feb 29, 2016
by
Johannes Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix on repeatable hours
parent
a62d2385
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
timeUtils.js
lib/timeUtils.js
+6
-2
No files found.
lib/timeUtils.js
View file @
74ec9bc5
...
@@ -139,7 +139,8 @@ function cyclicFromTillDay(daySpan, noInMonth, timeSpan, dateSpan, epochSpan) {
...
@@ -139,7 +139,8 @@ function cyclicFromTillDay(daySpan, noInMonth, timeSpan, dateSpan, epochSpan) {
function
_getNextNoInMonthOccurence
(
day
,
startDate
,
noInMonth
)
{
function
_getNextNoInMonthOccurence
(
day
,
startDate
,
noInMonth
)
{
startDate
=
new
Date
(
startDate
);
startDate
=
new
Date
(
startDate
);
console
.
log
(
'-----'
);
console
.
log
(
startDate
);
var
_noInMonth
;
var
_noInMonth
;
if
(
noInMonth
==
-
1
)
{
if
(
noInMonth
==
-
1
)
{
_noInMonth
=
1
;
_noInMonth
=
1
;
...
@@ -152,16 +153,19 @@ function _getNextNoInMonthOccurence(day, startDate, noInMonth) {
...
@@ -152,16 +153,19 @@ function _getNextNoInMonthOccurence(day, startDate, noInMonth) {
var
dayDiff
=
day
-
startDate
.
getDay
();
var
dayDiff
=
day
-
startDate
.
getDay
();
if
(
dayDiff
<
0
)
dayDiff
+=
7
;
if
(
dayDiff
<
0
)
dayDiff
+=
7
;
startDate
.
setDate
(
startDate
.
getDate
()
+
dayDiff
);
startDate
.
setDate
(
startDate
.
getDate
()
+
dayDiff
);
console
.
log
(
startDate
);
var
currentNoInMonth
=
Math
.
ceil
(
startDate
.
getDate
()
/
7
);
var
currentNoInMonth
=
Math
.
ceil
(
startDate
.
getDate
()
/
7
);
while
(
currentNoInMonth
!=
_noInMonth
)
{
while
(
currentNoInMonth
!=
_noInMonth
)
{
startDate
=
new
Date
(
startDate
.
getTime
()
+
7
*
24
*
3600000
);
startDate
.
setDate
(
startDate
.
getDate
()
+
7
);
//startDate = new Date(startDate.getTime() + 7 * 24 * 3600000);
currentNoInMonth
=
Math
.
ceil
(
startDate
.
getDate
()
/
7
);
currentNoInMonth
=
Math
.
ceil
(
startDate
.
getDate
()
/
7
);
}
}
if
(
noInMonth
==
-
1
)
{
if
(
noInMonth
==
-
1
)
{
startDate
.
setDate
(
startDate
.
getDate
()
-
7
);
startDate
.
setDate
(
startDate
.
getDate
()
-
7
);
}
}
console
.
log
(
startDate
);
return
startDate
;
return
startDate
;
}
}
...
...
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