Jump to content

Recommended Posts

Posted

Hi, will explaing

 

its for a booking, so i want to show today's date onwards, like 06 Jun 2017

 

so the customer can not select any prior dates like 05 Jun 2017

 

Thank you brother

Posted

Hi,

 

Can you try to use this approach for now ?!:

 

1. UnimDatePicker1 -> ... function afterCreate:

function afterCreate(sender)
{
    var me = sender;
    me.setPicker({
        listeners: {
            pick: function(picker, value) {
                me._selectedDate = Ext.Date.format(value, 'Y-m-d');
            }
        },
        doneButton: {
            listeners: {
                tap: function(button, event, eOpts) {
                    var _newDate = new Date(me._selectedDate);
                    if (me.minDate > _newDate) {
                        Ext.Msg.show({
                            showAnimation: false,
                            hideAnimation: false,
                            title: "Error",
                            message: "Incorrect Date...",
                            buttons: [Ext.MessageBox.OK],
                            icon: Ext.MessageBox.ERROR
                        });
                        return false;
                    }
                }
            }
        }
    })
}

2. UnimFormReady:

procedure TMainmForm.UnimFormReady(Sender: TObject);
begin
  UnimDatePicker1.JSInterface.JSCode(#1'.minDate=new Date("2017-06-07");');
end;

Best regards,

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...