Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.


untitled notebook

node v14.18.1
version: 1.0.0
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))

no comments

    sign in to comment