Jump to content

Recommended Posts

Posted

Hi,

sorry about that english.

 

The user can only click sundays and the other days not.

All days are visible.

Posted

Hi,

 

Try:

 

UniCalendar1->ClientEvents->UniEvents->[Ext.picker.Date[picker]] ... picker.beforeInit fn

function picker.beforeInit(sender, config)
{
  config.disabledDays = [1,2,3,4,5,6]
}

post-906-0-64520700-1466617891_thumb.png

 

Best regards.

Posted

Try:

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  UniSession.AddJS(UniCalendar1.JSName + '.down("datepicker").setDisabledDays([1,5])');
end;
  • 8 months later...
Posted

Hi,

 

Very useful forum! And how to disable some date? for example disable 20.03.2017 ?

 

One possible solution:

UniSession.AddJS(UniDateTimePicker1.JSName + '.setDisabledDates([''20/03/2017'', ''28.03.2017''])');

Best regards.

Posted

and the last here) disable enable datetimepicker days in runtime? I'm doing delivery days with possible denied days for celebrations.

see pic

 

I need admin to choose dates of delivery that possble and then client will choose one of them, except celebrations

 

post-2378-0-37928800-1490018504_thumb.jpg

Posted

trying to disable number of dates in 2 ways.

 

In Cycle doesn't work - disables only 1-st date - why??? Need this variant as main.

 

In StringList dates prepared like

 

20/03/2017

27/03/2017 

 

As a result i can disable only 1 date ( from all I  need


// 1-st way - works fine but !!! can't build such array
UniSession.AddJS(DateTimePicker.JSName + '.setDisabledDates([''20.03.2017'', ''27.03.2017''])');


// 2-d way - disables only first date
for i := 0 to SomeStringList.Count-1 do begin
Sleep(100);
UniSession.AddJS(DateTimePicker.JSName + '.setDisabledDates(['''+SomeStringList.[i]+'''])');
end;
Posted

Solved it!

for i := 0 to lbDisabledDeliveryDates.Count-1 do begin

if i=0 then s:=#39+lbDisabledDeliveryDates.Items[i]+#39 else
s:=s+','+#39+lbDisabledDeliveryDates.Items[i]+#39;

end;

UniSession.AddJS(DateTimePicker.JSName + '.setDisabledDates(['+s+'])');

  • Like 2
  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...