Jump to content

How to keep the slash mask in TUniDateTimePicker while the user typing


bahry

Recommended Posts

Hi,

Is there a way to keep the slash mask '  /  /    ' in the TUniDateTimePicker so the user does need to type it

while entering the date and to keep the : in the time field '  :  :  '.

 

if the user types 01032017 which suppose to be 01/03/2017 with a date format dd/mm/yyyy on exit it will be 03/01/2017

 

Regards

 

Link to comment
Share on other sites

Hi,

 

You can try to use this approach for now:

uses ... uniEdit; // need to add

forDate:

function afterrender(sender, eOpts)
{
    $("#"+sender.inputEl.id).inputmask("99/99/9999",{placeholder:"mm/dd/yyyy"});
}

forDateTime:

function date.afterrender(sender, eOpts)
{
    $("#"+sender.inputEl.id).inputmask("99/99/9999",{placeholder:"mm/dd/yyyy"});
}

function time.afterrender(sender, eOpts)
{
    $("#"+sender.inputEl.id).inputmask("99:99",{placeholder:"hh:mm"});
}

Best regards,

  • Upvote 1
Link to comment
Share on other sites

Thanks a lot, 

it works

 

Best Regards

 

Hi,

 

You can try to use this approach for now:

uses ... uniEdit; // need to add

forDate:

function afterrender(sender, eOpts)
{
    $("#"+sender.inputEl.id).inputmask("99/99/9999",{placeholder:"mm/dd/yyyy"});
}

forDateTime:

function date.afterrender(sender, eOpts)
{
    $("#"+sender.inputEl.id).inputmask("99/99/9999",{placeholder:"mm/dd/yyyy"});
}

function time.afterrender(sender, eOpts)
{
    $("#"+sender.inputEl.id).inputmask("99:99",{placeholder:"hh:mm"});
}

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