bBrowser time field display

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
Post Reply
Anonymous

bBrowser time field display

Post by Anonymous »

Hi. I'm trying to set the time format to hh:mm tt in a time column within a bbrowser using such methods as:

SetAmPm(false)
SetPMExt(" pm")
SetAMExt(" am")

in the postinit method of the screen on which the bbrowser appears, but nothing makes any difference. How do I get the desired result as shown in the attached screenshot below please?
tempsnip.png
tempsnip.png (42.93 KiB) Viewed 451 times
Jamal
Posts: 315
Joined: Mon Jul 03, 2017 7:02 pm

bBrowser time field display

Post by Jamal »

You need to provide an expression codeblock when you add your bDataColumn:

For example:

Code: Select all

oColumn := bDataColumn{SELF:oDCbBrowser1, SELF:oDCbBrowser1:Server,;
		{|oServer, oSelf| , MyFormatTime(oServer:FIELDGET(#JOBTIME)) )}, #Expression, self}
Create a MyFormatTime(sTime as String) function to return the value format you want.

Jamal
BiggyRat

bBrowser time field display

Post by BiggyRat »

Thanks so much Jamal.
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

bBrowser time field display

Post by robert »

Jeff

Code: Select all

SetAmPm(false)
SetPMExt(" pm")
SetAMExt(" am")
This changes global state. You should not do this in an app where more than one window or task can be running at the same time.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
BiggyRat

bBrowser time field display

Post by BiggyRat »

Ok. Thanks Robert. It was just used to test the workings of it.

On an unrelated (not in this screen) but related ( in just 2 other screens) I need to specifically put SetDateFormat("dd/MM/yyyy") to make dates appear in the right format in browsers, despite having it in my Start method.. I know 100% that at no point do I manually change date formats, as I have absolutely no reason to, or want to... connected maybe?
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

bBrowser time field display

Post by Karl-Heinz »

Hi Jeff,

SetAmPm(false) <-- is this just a typo, or are you really using SetAmPm(false) instead of SetAmPm(TRUE) ?
SetPMExt(" pm")
SetAMExt(" am")

In which format is a time stored in your server field ? what does a simple oServer:fieldget ( <yourTimeField> ) show ?

regards
Karl-Heinz
Post Reply