untitled notebook

node v14.17.6
version: 1.0.0
endpointsharetweet
const { DateTime } = require("luxon"); let startingTimeOfDay = null; const ADVANCE_RESERVATION_FURTHEST_DAY = 0; startingTimeOfDay = "08:00"; let now = DateTime.now().toUTC() if (startingTimeOfDay) { let t = startingTimeOfDay.split(':') let startingHour = t[0] let startingMinutes = t[1] now = DateTime.now().toUTC().startOf('day').plus({ hours: startingHour, minutes: startingMinutes }) } console.log('startDayTime', now.toISO()) console.log('startBookingTime', DateTime.fromISO("2021-10-14T13:30:01.587+05:30", {zone: "UTC"}).toISO()) let startBookingTime = DateTime.fromISO("2021-10-14T13:29:00.587+05:30", {zone: "UTC"}) console.log(Math.floor(startBookingTime.diff(now, 'days').days))
Loading…

no comments

    sign in to comment