Desktop system Date

Desktop Date

Hello everyone
xojo
The present is to greet you and thank you for the provision of your time in the attention of the present:

I have a desktop system where you enter documents with dates dd/mm/yyyy format and it is very important the speed of entry or modification with the keyboard, I made a small class from a textfield, but I am not very convinced, I have drawbacks when the date entered is modified, especially when I delete the digits of the day or the month and move the “/”

some scope will be very appreciated to apply it to my system

Infinite Thanks

Raul Juarez Pulache

I cannot talk for others, but I do not understand what the question is.

Can you be more specific on what help you are asking ?

PS: did you set a mask ? Argggh ! You do not even tell us what control you are using to allow the user to enter the date. TextField ? Special Canvas Class ? Other ?

If you use a TextField, are-you using a CueText (TextField1.CueText = "DD/MM/AAAA") ?
A mask in a Textfield is set as TextField1.Mask = "##/##/####"

what i did is create a class for textfield/textarea with a property DateYN. if the field is set to DateYN, on the lost focus of the event, i check if the field is “;” and then set it to current date in dd/mm/yyyy or mm/dd/yyyy. if user enter 0101, it is set to 01/01/2017. if user enter 010116, it is convert to 01/01/2016

Dear Richard Duke

Thank you for your response, I could detail the DateYN property
I do not have much knowledge about this

regards

Raul

[quote=351478:@Raul Juarez Pulache]Dear Richard Duke

Thank you for your response, I could detail the DateYN property
I do not have much knowledge about this

regards

Raul[/quote]

DateYN is just a new property i added in the subclass of the textarea or textfield.

you could check if the entered text is EXACTLY 10 characters long. something like this:

if len(trim(textfield.text))<>10 then msgbox "please enter 10 digits for date" end if

maybe this could help you too

if date_format = "dmy" then day = mid(textfield.text,1,2) day = mid(textfield.text,4,2) day = mid(textfield.text,7,4) end if

I do the same as @Richard Duke - if speed is important, skip all the formatting and just let the user enter 2, 4, 6, or 8 digits and interpret them when they leave the field.