Run vs Deploy - strange behavior difference

  1. 2 weeks ago

    Val K

    May 10 Pre-Release Testers, Xojo Pro

    Hi, all,

    I am developing a web application that I want to be active only on specific dates.

    On the main paige, I've created TextField1 whose Visible is set to False.

    Then I created a Timer with the following code

    Dim d as New Date
    Dim password As String
    
    if d.ShortDate="5/10/19" then
      TextField1.Visible=True
    end

    When I test the app via the Run, it works as expected.

    When it is deployed on the XOJO server (San Francisco) it fails to make the TextField1 visible.

    Could someone help me please?

    Thank you,

    Val

  2. Tim P

    May 10 Pre-Release Testers Rochester, NY
    Edited 2 weeks ago

    ShortDate is localized, what do you get if you put a label on the page with the ShortDate when deployed?

    Edit: Also, that's a horrible way to test dates because of the localization issues. Create two date objects and test those - not strings.

  3. Rick A

    May 10 (Brazil. GMT-3:00)

    Or use an universal format like:

    If d.SQLDate="2019-05-10" Then...

  4. Val K

    May 10 Pre-Release Testers, Xojo Pro

    The label shows "05/10/2019"

    I changed "05/10/19" into "05/10/2019" and it helped!

    Now it is working!

    I will also try the d.SQLDate,

    Thank you both, guys,

    Have a good weekend.

    Val

or Sign Up to reply!