We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This example wont work, it should return available true. :(
import { getSlots } from "slot-calculator"; import { DateTime, Settings } from "luxon"; //Settings.defaultZone = "UTC"; const dateTimeRef = DateTime.utc(2023, 1, 24); const weekday = dateTimeRef.weekdayLong; console.log(weekday) const allSlots = getSlots({ from: "2023-01-24T12:00:00-03:00", to: "2023-01-24T13:00:00-03:00", outputTimezone: "America/Sao_Paulo", duration: 60, unavailability:[], availability: [ { day: "segunda", from: "09:00", to: "19:00", timezone: "America/Sao_Paulo" },{ day: "terca-feira", from: "01:00", to: "23:00", timezone: "America/Sao_Paulo" }, { day: "quarta-feira", from: "09:00", to: "19:00", timezone: "America/Sao_Paulo" }, { day: "quinta-feira", from: "09:00", to: "19:00", timezone: "America/Sao_Paulo" }, { day: "sexta-feira", from: "09:00", to: "19:00", timezone: "America/Sao_Paulo" } ] }); console.log(allSlots);
The text was updated successfully, but these errors were encountered:
Thanks for creating this issue @mfandre
I believe this is because you are entering weekdays like segunda instead of Monday.
segunda
Monday
Internationalisation could definitely be better supported for weekdays, I will look into this for you
Sorry, something went wrong.
@mfandre Fixed in latest release 7d0b064
You can now do something like this:
getSlots({ from: dateTimeRef.plus({ hour: 3 }).toISO(), to: dateTimeRef.plus({ hour: 5 }).toISO(), outputTimezone: "America/Sao_Paulo", duration: 60, availability: [ { day: { text: "sábado", locale: "pt-br", }, from: "00:00", to: "01:00", timezone: "America/Sao_Paulo", }, ], })
No branches or pull requests
This example wont work, it should return available true. :(
The text was updated successfully, but these errors were encountered: