How to grab all days in current month, and process them?
See original GitHub issueHi,
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:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@youradds the
fp.daysContainer
field contains all the month containers with days.I’ll get you a quick snippet in a bit
Closing this due to inactivity. Please feel free to open another issue if you need more help from us