Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Disable Dates in Qwidget Date picker

Hi all,

jagan

hic

I am Using date picker in my app,

I tried to disable dates using min date and max date, but dates are not disabling.

I used below expression:

<wi-datepicker bind-qs-var="vEndDate" popup="true" default="vMaxDate" min-date="vMinDate" max-date="vMaxDate">

</wi-datepicker>

variables and load script:

CalendarTemp:

LOAD

  Max(CanonicalDate) AS DateMax,

  Min(CanonicalDate) AS DateMin

RESIDENT CalendarMaster;

LET vMaxDate = FieldValue('DateMax', 1);

LET vMinDate = FieldValue('DateMin', 1) -1; // Needed to control the minum date autogenerated in Sales table is included in the MasterCalendar

DROP TABLE CalendarTemp;

let vStartDate = Date('$(vMinDate)');

let vEndDate = Date('$(vMaxDate)');

let vYesterday = date(vMaxDate)-1;

Thanks,

Pramod

Tags (1)
16 Replies
balrajahlawat
Esteemed Contributor

Re: Disable Dates in Qwidget Date picker

Not applicable

Re: Disable Dates in Qwidget Date picker

I went through all above discussions.

I have done same has michael torralo's example the date picker is working fine, but i am not able to disable the dates according to max and min dates.

balrajahlawat
Esteemed Contributor

Re: Disable Dates in Qwidget Date picker

did you try with this:

Disabled Dates

Html:

<wi-datepicker bind-qs-var="vDate" popup="true" min-date="2014-10-20" max-date="2014-10-31" > </wi-datepicker>
balrajahlawat
Esteemed Contributor

Re: Disable Dates in Qwidget Date picker

see this for details:

qWidget | Datepicker Component

Not applicable

Re: Disable Dates in Qwidget Date picker

I don't want to hardcode the dates, i need max(date) if i hardcode it is working fine.

Not applicable

Re: Disable Dates in Qwidget Date picker

One thing i know is this due to date formatting, Qwidget is expecting in the format  max-date="2014-10-31",

I think my date format is not matching with it.

Even though i tried with max-date="date(vMaxDate,'YYYY-MM-DD')" is not working.

Anyone help on this, where i am going wrong.

balrajahlawat
Esteemed Contributor

Re: Disable Dates in Qwidget Date picker

may be like this:

max-date="date($(vMaxDate),'YYYY-MM-DD')"

Not applicable

Re: Disable Dates in Qwidget Date picker

I tried this also not working

balrajahlawat
Esteemed Contributor

Re: Disable Dates in Qwidget Date picker

what is this max-date??

If these are two fields:

date(max(Date),'YYYY-MM-DD') - date(Date,'YYYY-MM-DD')