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.

DatePicker: offer updating disabled dates and days through widgetVar

See original GitHub issue

I’m using disabled dates based on a database query. I’ve chosen to only fetch the available dates based on the currently visible month. I was planning to use the viewChange listener to fetch available dates again when the view changes. The listener is called, but the component does not (re)read the disabled dates list. I tried updating the component, but that will cause the popup to close.

I would be nice if we could use something similar to the LazyScheduleModel and keep the number of requests limited.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
mellowarecommented, Sep 2, 2020

Why not in your viewChange use oncomplete='javascript() to update the DatePicker’s internal disabledDates array.

if (this.options.disabledDates) {
                for (var i = 0; i < this.options.disabledDates.length; i++) {
                    this.options.disabledDates[i] = this.parseOptionValue(this.options.disabledDates[i]);
                }
            }

That is what controls the disabled dates in the drawing of the component. Or you could try this in the oncomplete

widget.jq.datePicker('_setInitValues');

That would reinitialize all the init values like disabledDates.

0reactions
mellowarecommented, Sep 6, 2020

If you can figure it out i would create a new issue and PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

disabled dates not updating on view when we add through ...
I have used vue-hotel-date-picker its working fine. the issue is when using disabled dates props its disabled the dates first time when ...
Read more >
DatePicker | PrimeFaces JavaScript API Docs
PrimeFaces DatePicker Widget. DatePicker is an input component used to select a date featuring display modes, paging, localization, ajax selection and more.
Read more >
DatePicker (java.util.Date) - PrimeFaces Showcase
Date ). DatePicker is an input component to select a date. ... < p:outputLabel for = "disabledDD" value = "Disabled Date/Day:" />. <...
Read more >
[OutSystems UI] Updated Date Picker
Pass the array of date which needs to be disabled; Defined weekends function in the JS snippet will take care of disabling the...
Read more >
Date Range Picker — JavaScript Date & Time Picker Library
Originally created for reports at Improvely, the Date Range Picker can be attached ... for selecting dates, times, or predefined ranges like "Last...
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