Welcome, Guest
Username: Password: Remember me
Visual Objects

Please use this forum to post questions about Visual Objects and Vulcan.NET
  • Page:
  • 1

TOPIC:

bBrowser time field display 08 Nov 2019 01:40 #11650

  • BiggyRat
  • BiggyRat's Avatar
  • Topic Author



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?

Attachments:

Please Log in or Create an account to join the conversation.

bBrowser time field display 08 Nov 2019 06:49 #11651

  • Jamal
  • Jamal's Avatar


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

    For example:
    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

    Please Log in or Create an account to join the conversation.

    Last edit: by Jamal.

    bBrowser time field display 09 Nov 2019 00:32 #11652

    • BiggyRat
    • BiggyRat's Avatar
    • Topic Author



    Thanks so much Jamal.

    Please Log in or Create an account to join the conversation.

    bBrowser time field display 09 Nov 2019 13:07 #11661

    • robert
    • robert's Avatar


  • Posts: 3595
  • Jeff
    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

    Please Log in or Create an account to join the conversation.

    bBrowser time field display 09 Nov 2019 13:56 #11665

    • BiggyRat
    • BiggyRat's Avatar
    • Topic Author



    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?

    Please Log in or Create an account to join the conversation.

    Last edit: by BiggyRat.

    bBrowser time field display 09 Nov 2019 16:25 #11669

    • Karl-Heinz
    • Karl-Heinz's Avatar


  • Posts: 774
  • 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

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1