-
Notifications
You must be signed in to change notification settings - Fork 611
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dxScheduler - fix recurrent appointment rendering with workWeek view …
…(T853629) (#11660)
- Loading branch information
1 parent
099f3ed
commit 24b129f
Showing
6 changed files
with
68 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const dateUtils = require('../../../core/utils/date'); | ||
const MONDAY_INDEX = 1; | ||
const SATURDAY_INDEX = 6; | ||
const SUNDAY_INDEX = 0; | ||
|
||
export const isDataOnWeekend = (date) => { | ||
const day = date.getDay(); | ||
return day === SATURDAY_INDEX || day === SUNDAY_INDEX; | ||
}; | ||
|
||
export const getFirstDayOfWeek = (firstDayOfWeekOption) => { | ||
return firstDayOfWeekOption || MONDAY_INDEX; | ||
}; | ||
|
||
export const getWeekendsCount = (days) => { | ||
return 2 * Math.floor(days / 7); | ||
}; | ||
|
||
export const getFirstViewDate = (viewStart, firstDayOfWeek) => { | ||
const firstViewDate = dateUtils.getFirstWeekDate(viewStart, firstDayOfWeek); | ||
return dateUtils.normalizeDateByWeek(firstViewDate, viewStart); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters