https://github.com/itwillwork/work-time-diff
https://github.com/itwillwork/work-time-diff
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/itwillwork/work-time-diff
- Owner: itwillwork
- Created: 2023-05-27T12:40:24.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-27T13:38:56.000Z (almost 3 years ago)
- Last Synced: 2025-04-19T11:28:42.485Z (11 months ago)
- Language: TypeScript
- Size: 75.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### work-time-diff
#### Installation
```
npm i work-time-diff
```
#### Usage
```ts
const { getWorkTimeDiff } = require('work-time-diff');
const workingTime = {
workingHours: {
from: 10,
to: 20,
},
workingDays: ['1', '2', '3', '4', '5'], // mon, tue, wed, thu, fri
daysOff: ['2023-05-29'],
};
const diff = getWorkTimeDiff(workingTime, '2023-05-26T14:00:00+03:00', '2023-05-30T14:00:00+03:00', 'hours');
console.log(diff); // 10
```