@multisystemsuite/timezone-engine-business-hours 4.0.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,7 +1,63 @@
|
|
|
1
1
|
# @multisystemsuite/timezone-engine-business-hours
|
|
2
2
|
|
|
3
|
-
Regional business
|
|
3
|
+
Regional **business-hours engine** for enterprise workforce scheduling, ERP attendance, and SaaS booking windows.
|
|
4
|
+
|
|
5
|
+
## What it is used for
|
|
6
|
+
|
|
7
|
+
- Check if a datetime falls inside business hours for a timezone
|
|
8
|
+
- Regional workforce availability (US, EU, India, etc.)
|
|
9
|
+
- Gate notifications, cron jobs, and API actions to open hours
|
|
10
|
+
- HRMS / ERP shift and attendance modules
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @multisystemsuite/timezone-engine-business-hours
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
import { businessHoursEngine } from "@multisystemsuite/timezone-engine-business-hours";
|
|
22
|
+
|
|
23
|
+
const hours = businessHoursEngine("America/New_York", {
|
|
24
|
+
start: "09:00",
|
|
25
|
+
end: "17:00",
|
|
26
|
+
days: [1, 2, 3, 4, 5], // Mon–Fri
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const open = hours.isBusinessHour(new Date());
|
|
30
|
+
const day = hours.getLocalDay(new Date()); // 0=Sun … 6=Sat
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### With React
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
import { BusinessHours, useBusinessHours } from "@multisystemsuite/timezone-engine-react";
|
|
37
|
+
|
|
38
|
+
function Status() {
|
|
39
|
+
const { isOpen, timezone } = useBusinessHours("Europe/London");
|
|
40
|
+
return <BusinessHours timezone={timezone} />;
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Key exports
|
|
45
|
+
|
|
46
|
+
| Export | Purpose |
|
|
47
|
+
| -------------------------------------- | --------------------------------- |
|
|
48
|
+
| `businessHoursEngine()` | Create engine for a timezone |
|
|
49
|
+
| `BusinessHoursEngine.isBusinessHour()` | Check if datetime is within hours |
|
|
50
|
+
| `BusinessHoursEngine.getLocalDay()` | Weekday in target timezone |
|
|
51
|
+
|
|
52
|
+
## Related packages
|
|
53
|
+
|
|
54
|
+
- `@multisystemsuite/timezone-engine-scheduler` — meetings and shifts
|
|
55
|
+
- `@multisystemsuite/timezone-engine-react` — `BusinessHours` component
|
|
4
56
|
|
|
5
57
|
## Keywords
|
|
6
58
|
|
|
7
59
|
`timezone`, `business-hours`, `workforce`, `scheduling`, `enterprise`, `erp`
|
|
60
|
+
|
|
61
|
+
## License
|
|
62
|
+
|
|
63
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@multisystemsuite/timezone-engine-business-hours",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Regional business hours engine for @multisystemsuite/timezone-engine",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "MultiSystemSuite",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"date-fns-tz": "^3.2.0",
|
|
38
|
-
"@multisystemsuite/timezone-engine-core": "
|
|
39
|
-
"@multisystemsuite/timezone-engine-
|
|
40
|
-
"@multisystemsuite/timezone-engine-
|
|
38
|
+
"@multisystemsuite/timezone-engine-core": "5.0.0",
|
|
39
|
+
"@multisystemsuite/timezone-engine-scheduler": "5.0.0",
|
|
40
|
+
"@multisystemsuite/timezone-engine-shared-types": "5.0.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"rimraf": "^6.0.1",
|