Prevent date field from changing format on data entry (1 Viewer)

5hadow

Member
Local time
Today, 04:07
Joined
Apr 26, 2021
Messages
89
I have a date and time fields which displays what I want it to display. I've also set up an input mask for users to enter what I need them to enter.
It looks like:
1653362915678.png

However, when I try to edit the field it changes the format.
When clicking on date field:
1653362979522.png

When clicking on time field:
1653363004784.png


How do I prevent this behavior?
It's confusing for some users because if you do make a change, it doesn't work with input mask and I get an error.
 

sonic8

AWF VIP
Local time
Today, 10:07
Joined
Oct 27, 2015
Messages
998
I have a date and time fields which displays what I want it to display. I've also set up an input mask for users to enter what I need them to enter.
[...]
It's confusing for some users because if you do make a change, it doesn't work with input mask and I get an error.
Maybe your users would be less confused if you don't display the data the way you want it to be displayed but the way they want it displayed.

Except for reports that get distributed to other people, I don't see any reason to display the dates differently than the user wants to see them.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 16:07
Joined
May 7, 2009
Messages
19,232
what is being Displayed (without you clicking it first), is the way you Format you date/time.
when you clicked on it, it now display what you define on your Locale setting.

to prevent this set the locale and your format date the same.
but if others are using your db, that is the problem.
i don't know if you can convinced them to change their computers locale settings.
 

5hadow

Member
Local time
Today, 04:07
Joined
Apr 26, 2021
Messages
89
what is being Displayed (without you clicking it first), is the way you Format you date/time.
when you clicked on it, it now display what you define on your Locale setting.

to prevent this set the locale and your format date the same.
but if others are using your db, that is the problem.
i don't know if you can convinced them to change their computers locale settings.
Ok, that's what I thought. I knew it was something to do with local time. Thanks!
 

Eugene-LS

Registered User.
Local time
Today, 11:07
Joined
Dec 7, 2018
Messages
481
How do I prevent this behavior?
I did so:
I copied the date (time) value from hidden field into an unrelated text field on the Form_OnCurrent event, checked for IsDate() or IsTime() after editing, and then copied back ...
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 16:07
Joined
May 7, 2009
Messages
19,232
I copied the date (time) value from hidden field into an unrelated text field on the Form_OnCurrent event,
how about on Continuous form?:unsure:
 

Users who are viewing this thread

Top Bottom