Jump to content

UnimDatePicker hide or block previous dates


epos4u

Recommended Posts

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,

Link to comment
Share on other sites

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