How to format display of Input Control ??

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
gernotlg
Posts: 80
Joined: Fri Aug 27, 2021 1:24 am

How to format display of Input Control ??

Post by gernotlg »

I can't seem to find a way to format the display of an input control... namely a Date value.

The Input control is in the Top Bar of a VP.

If I set the format of the attribute that it is tied to (CurrentSession.SelectedDate) to dd/MM/yyyy then 3 things happen...
1. The initial value of CurrentSession.SelectedDate (which is CURRENT_DATE) does not get displayed (when current day is > 12), or displays as MM/dd/yyyy
2. The date displayed in the input control (after selecting from the date picker) is still MM/dd/yyyy.
3. The query results are muddled up and the returned values are wrong as per example...
---- If I selected 8th June 2021 from date picker...
-------- the displayed value in the input control will be 06/08/2021 = MM/dd/yyyy.
-------- the query results will be for 6th August 2021 (06/08/2021 = dd/MM/yyyy .. which is the format of the attribute in session object)

So, this suggests that the date picker is putting the date value into the input control, which is displaying as MM/dd/yyyy, then this value must be getting sent to the session object as text(??) instead of as a date value, because when it ends up in the session object (which is formatted as dd/MM/yyyy) it has mixed up the day and the month.

This looks like a bug to me.


But I would probably be able to overcome this, if I could format the Input Control as dd/MM/yyyy.

Any suggestions ?

Thanks
G
V8.8 / Windows / MySQL
Jaymer
Posts: 2450
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: How to format display of Input Control ??

Post by Jaymer »

I use DATE fields in Top Bar with success.
Most likely a bug dealing with the diff formatting.
You could call a process when it changes and via DISPLAY MESSAGE or some display on a form try to see what value is really in there. No need for conversion to/from PlaintText field in my opinion.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
gernotlg
Posts: 80
Joined: Fri Aug 27, 2021 1:24 am

Re: How to format display of Input Control ??

Post by gernotlg »

Thanks Jaymer, but I can already see what the value is... the value of the Input control is, when I click on the calender button which is part of the control, (highlighted in yellow), and the value passed to the query is day and month swapped around.
Screenshot 2023-01-30 120635.jpg
Screenshot 2023-01-30 120635.jpg (20.99 KiB) Viewed 796 times
Screenshot 2023-01-30 120712.jpg
Screenshot 2023-01-30 120712.jpg (14.22 KiB) Viewed 796 times
That bug aside... how would I format the Input Control to display dd/MM/yyyy ?
V8.8 / Windows / MySQL
Jaymer
Posts: 2450
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: How to format display of Input Control ??

Post by Jaymer »

set the format of that attribute in your NP session BO.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Post Reply