From b4803c17dee308bbdb4a6a88539b6b0da6716ddf Mon Sep 17 00:00:00 2001 From: Ansul Agrawal Date: Wed, 13 Nov 2024 01:01:28 +0530 Subject: [PATCH 1/2] Fix the locale issue --- src/components/EventItem.jsx | 2 +- src/components/SchedulerData.js | 2 +- src/helper/behaviors.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/EventItem.jsx b/src/components/EventItem.jsx index bf7fc30..6e60b45 100644 --- a/src/components/EventItem.jsx +++ b/src/components/EventItem.jsx @@ -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; diff --git a/src/components/SchedulerData.js b/src/components/SchedulerData.js index fdfed08..cdcfbdc 100644 --- a/src/components/SchedulerData.js +++ b/src/components/SchedulerData.js @@ -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 }); diff --git a/src/helper/behaviors.js b/src/helper/behaviors.js index f1a56f8..4ad657d 100644 --- a/src/helper/behaviors.js +++ b/src/helper/behaviors.js @@ -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; }; From a527ef9a5094246e13d7be105af00267633fff84 Mon Sep 17 00:00:00 2001 From: Ansul Agrawal Date: Wed, 13 Nov 2024 01:15:18 +0530 Subject: [PATCH 2/2] updated package version and changelog --- CHANGELOG.md | 5 +++++ package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cdcd7de..fdfc910 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Logs: +## [4.4.4](https://github.com/react-scheduler/react-big-schedule/compare/4.4.3...4.4.4) +`2024-11-13` + +- Fix the `dayjs` locale issue by [@ansulagrawal](https://github.com/ansulagrawal) in [#178](https://github.com/react-scheduler/react-big-schedule/pull/179). + ## [4.4.3](https://github.com/react-scheduler/react-big-schedule/compare/4.4.2...4.4.3) `2024-10-28` diff --git a/package.json b/package.json index bc7aac5..f600c5e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-big-schedule", - "version": "4.4.3", + "version": "4.4.4", "description": "React Big Schedule is a powerful and intuitive scheduler and resource planning solution built with React. Seamlessly integrate this modern browser-compatible component into your applications to effectively manage time, appointments, and resources. With drag-and-drop functionality, interactive UI, and granular views, react-big-schedule empowers users to effortlessly schedule and allocate resources with precision. Enhance productivity and streamline your workflow with this React-based solution, designed to optimize time management and simplify calendar-based operations. Perfect for applications requiring advanced scheduling capabilities, react-big-schedule offers a seamless and intuitive experience for managing appointments, resource allocation, and time slots. Unlock the potential of your React projects with react-big-schedule and revolutionize the way you handle scheduling and resource planning. It is the updated version of react-big-scheduler", "keywords": [ "react-big-schedule",