This library allows you to calculate the total work hours between two specified dates and times.
🇺🇸 [English][en-docs] | 🇦🇴[pt-docs]
npm i counts-hour
The date function takes two dates as parameters and calculates the number of days between them. date(firstdate, seconddate)
firstdate (string): The first date to be used in the calculation. The date should be in the format 'yyyy-mm-dd'. seconddate (string): The second date to be used in the calculation. The date should be in the format 'yyyy-mm-dd'. Date format: year month day format: '2022-01-01'
const {date} = require("counts-hour");
console.log(date('2022-01-01', '2022-01-02'))
These functions calculate the number of hours and minutes between two dates and times passed as parameters. firstdate, firsthour, seconddate, secondhour
firstdate (string): The first date to be used in the calculation. The date should be in the format 'yyyy-mm-dd'. firsthour (string): The first time to be used in the calculation. The time should be in the format 'hh:mm'. seconddate (string): The second date to be used in the calculation. The date should be in the format 'yyyy-mm-dd'. secondhour (string): The second time to be used in the calculation. The time should be in the format 'hh:mm'.
hourSync(firstdate, firsthour, seconddate, secondhour)
const {hourSync} = require("counts-hour");
console.log(hourSync('2022-01-01', '13:30', '2022-01-02', '14:34'))
hourCall(firstdate, firsthour, seconddate, secondhour,(data,erro)=>{
console.log(data) })
const {hourCall} = require("counts-hour");
hourCall('2022-01-01', '13:30', '2022-01-02', '14:34',(data,erro)=>{
console.log(data)
})
hourPromise(firstdate, firsthour, seconddate, secondhour) .then((date)=>{
console.log(date) })
const {hourPromise} = require("counts-hour");
hourPromise('2022-01-00', '13:30', '2022-01-02', '14:34')
.then((date)=>{
console.log(date)
})
[MIT][license-url] © Antonio Avelino, Florentino Matos
21508fb0113d7bac70d6362c15b6d4cd8af37d54