Migrated from Redmine #200 | Author: Franjo Eric
Status: New | Priority: Normal | Created: 2018-07-23
Hi there,
I have this issue with calculating endTime
I have nodejs service and I’m getting data over APi.
I’m wondering about function calculateEndTime, in documentation it says “Returns end datetime if booking is available, else return false”.
So even if my startDateTime is unavailable I’m getting endTime in response instead of false.
Am I something figured wrong or API does not work properly?
This is my req URL
http://localhost:8585/v1/calculate-end-time/startDateTime/2018-07-25 10:30:00/service/1/unit/1
NODEJS GET route
router.get(“/calculate-end-time/startDateTime/:startDateTime/service/:service/unit/:unit”, function (req, res) {
let { startDateTime } = req.params;
let service = parseInt(req.params.service)
let unit = parseInt(req.params.unit)
let data = adminAPI.calculateEndTime(startDateTime, service, unit)
res.send(data)
})
and response is always endTime as string, never false.
In Screenshoot you can see that datetime is unavailable.
Thank you,
kind regards