Skip to content

Commit

Permalink
Fix locale issue (#179)
Browse files Browse the repository at this point in the history
Fix Locale highlighting issue: #170 

Thanks to @luguco for raising a bug.
  • Loading branch information
ansulagrawal authored Nov 12, 2024
2 parents 47093f3 + b4803c1 commit 15768c3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/EventItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const stopDragHelper = ({ count, cellUnit, config, dragType, eventItem, localeDa
while (whileTrue) {
i = count > 0 ? i + 1 : i - 1;
const date = localeDayjs(new Date(eventItem[dragType])).add(i, 'days');
const dayOfWeek = date.weekday();
const dayOfWeek = date.day();

if (dayOfWeek !== 0 && dayOfWeek !== 6) {
tCount = count > 0 ? tCount + 1 : tCount - 1;
Expand Down
2 changes: 1 addition & 1 deletion src/components/SchedulerData.js
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ export default class SchedulerData {
} else if (this.cellUnit === CellUnit.Day) {
while (header >= start && header <= end) {
const time = header.format(DATETIME_FORMAT);
const dayOfWeek = header.weekday();
const dayOfWeek = header.day();
if (this.config.displayWeekend || (dayOfWeek !== 0 && dayOfWeek !== 6)) {
const nonWorkingTime = this.behaviors.isNonWorkingTimeFunc(this, time);
headers.push({ time, nonWorkingTime });
Expand Down
2 changes: 1 addition & 1 deletion src/helper/behaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const isNonWorkingTime = (schedulerData, time) => {
const hour = localeDayjs(new Date(time)).hour();
return hour < 9 || hour > 18;
}
const dayOfWeek = localeDayjs(new Date(time)).weekday();
const dayOfWeek = localeDayjs(new Date(time)).day();
return dayOfWeek === 0 || dayOfWeek === 6;
};

Expand Down

0 comments on commit 15768c3

Please sign in to comment.