question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to grab all days in current month, and process them?

See original GitHub issue

Hi,

This isn’t a bug report as such - I’m just trying to figure out if this is possible. So I have an inline calendar I want to use to show available dates for a room booking:

    window.VARS.ViewOtherDateDatepicker = flatpickr("#embed-calendar-avail input.date", {
        minDate: "today",
        inline: true,
        dateFormat: "d-m-Y",
        onDayCreate: function(dObj, dStr, fp, dayElem){

        }
    });

What I want to be able to do is grab ALL the dates in the current visible month, and then send that off to a server script to check the availability. Then that would return a JSON object, and I can go through and update each of the dates that are not available. I found the onDayCreate() function that I could use, but I really don’t want to as it’s going to mean I need to do 29-31 AJAX requests every single time the month changes (which is a waste of server resources, and the users). Is there a way around this?

Thanks!

Andy

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
chmlncommented, Dec 6, 2018

@youradds the fp.daysContainer field contains all the month containers with days.

I’ll get you a quick snippet in a bit

0reactions
viorelsfeteacommented, Apr 9, 2019

Closing this due to inactivity. Please feel free to open another issue if you need more help from us

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get all days in current month? - python - Stack Overflow
Here's a solution with datetime and calendar : >>> import datetime, calendar >>> year = 2014 >>> month = 1 >>> num_days =...
Read more >
mysql - get all dates in the current month
It will fetch all dates from 30-31 days ago up to the current date (and to the future, if there are rows with...
Read more >
Excel formula: Days in month - Excelchat - Got It AI
Our DAY function is always equal to the number of days in the month. The EOMONTH function checks the date in Cell B4...
Read more >
Get the Number of Days in a Month using JavaScript
The method will return the date corresponding to the last day of the month. Call the `getDate()` method on the result to get...
Read more >
How to get all days of current month? - Studio
I want to get all days of current month starting from 1st date.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found