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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...