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.

Select other dates even there are disabled date in the middle of desired dates

See original GitHub issue

Is it possible to select dates between a disabled date? I tried to disable a specific date. e.g. (2018-08-17). I still want to select dates from 2018-08-16 to 2018-08-18.

function pad(number, length) {
   
                var str = '' + number;
                while (str.length < length) {
                    str = '0' + str;
                }
            
                return str;

            }
beforeShowDay: function(t)
                {
                    $dates = '2018-08-17';
                    $calendar_date = t.getFullYear()+"-"+(pad(t.getMonth()+1, 2))+"-"+pad(t.getDate(), 2);
                    var valid = !($calendar_date == $dates);
                    var _class = valid ? '' : 'invalid';
                    var _tooltip = valid ? '' : 'This is already taken.';
                    return [valid,_class,_tooltip];
                },

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

3reactions
holtkampcommented, Aug 8, 2018

@windchime18 thanks for the screenshot, that helps understanding your case! Indeed, I think by default this is not supported.

When looking at example#26 at https://longbill.github.io/jquery-date-range-picker/ this does also not work by default.

But it seems it is possible, please see this comment https://github.com/longbill/jquery-date-range-picker/issues/352#issuecomment-351705025, it refers to this example: https://jsfiddle.net/maximelafarie/dnbd01do/21/

In that example the Sundays are disabled, but I can easily select a range from Friday to Monday…

Does this help you?

1reaction
holtkampcommented, Aug 9, 2018

Credits go to @maximelafarie !

Maybe this functionality can be adopted in the library, a Pull Request would be welcome.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to remove disabled date count in datepicker
I'm trying to get date count amount within these days selection. Usually I get date count correctly. But when I select date range...
Read more >
How to disable days from being selected on the Date/Time ...
I think this is why it appears that those dates can't be clicked- because after you click one that you aren't "allowed" to,...
Read more >
Disable some Date in the Rad date Picker - Telerik
My purpose is to disable all the dates other than a particular range of dates. I know I can use Min and Max...
Read more >
Possible to select a disabled date with the keyboard #723
Possible to select a disabled date with the keyboard #723 ... Disabled dates still accessible using keyboard or manually entered dates #582.
Read more >
AD disabled date - Microsoft Q&A
AD disabled date. Is there a user attribute anywhere in AD which captures the date and time an account was disabled? Or any...
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