Home Server
New Blog Posts: Merging Reports - Part 1 and Part 2

Date settings in search form

edited October 2006 in Server
Hello,

We are wondering how we can set the date format used in the auto search
form. It appears to be always in mm/dd/yyyy format, regardless of language
settings of both client and server.

Can we change it in code?

Kind regards,
Mariella

Comments

  • edited October 2006

    - for the ClientReport, see the following article.

    - the WebTier currently does not support alternate formatting because the
    JavaScript validation code is not flexible enough. This is on the list of
    things to improve.

    -------------------------------------------------
    Tech Tip: Date formats used by DADE
    -------------------------------------------------

    DADE handles in two phases:


    1. User entry

    This occurs when the user specifies a date using the Query tools or the
    AutoSearch dialog. DADE converts the date string entered by the user into a
    Delphi TDateTime value. The string entered by the user is converted using
    Delphi's StrToDateTime. By default Delphi's StrToDateTime relies on the date
    formatting variables for the current windows locale. These can be overridden
    by the developer. See Delphi online help for StrToDateTime for more
    information.


    2. SQL submitted to the server

    When generating the SQL to be submitted to the database server, DADE
    converts the TDateTime value from number 1 above, to a string using the
    Delphi's FormatDateTime function. The format string used to convert the
    TDateTime is specified by the TdaSession.GetSearchCriteriaDateFormat and
    TdaSession.GetSearchCriteriaTimeFormat functions. These are virtual methods
    which may be overridden by descendant TdaSession classes.

    Below are the default values returned.


    {------------------------------------------------------------------------------}
    { TdaSession.GetSearchCriteriaDateFormat }

    function TdaSession.GetSearchCriteriaDateFormat(aDatabaseType:
    TppDatabaseType; const aDatabaseName: String): String;
    begin

    {return a format usable by FormatDate}
    case aDatabaseType of

    dtMSAccess:
    Result := 'YYYY-MM-DD';

    dtMSSQLServer, dtSybaseASA, dtSybaseASE, dtOracle:
    Result := 'YYYY/MM/DD';

    dtAdvantage:
    Result := 'YYYY-MM-DD';

    else
    Result := 'MM/DD/YYYY';

    end;

    end; {function, GetSearchCriteriaDateFormat}

    {------------------------------------------------------------------------------}
    { TdaSession.GetSearchCriteriaTimeFormat }

    function TdaSession.GetSearchCriteriaTimeFormat(aDatabaseType:
    TppDatabaseType; const aDatabaseName: String): String;
    begin
    {return a format usable by FormatDateTime}
    case aDatabaseType of

    dtMSAccess:
    Result := 'HH::MM::SS';

    else
    Result := 'HH:MM:SS';
    end;

    end; {function, GetSearchCriteriaTimeFormat}



    Note: DADE augments the above with additional formatting delimiters for
    Oracle and MSAccess. See TdaSQL.ResolveCriteria located in
    RBuilder\Source\daSQL.pas for more information.






    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited October 2006
    Hi Nard,

    Could you give an estimate when this problem will be tackled?
    Not being able to use another date format other than mm/dd/yyyy is
    hard to explain to a lot of our European customers.

    regards
    Paul

    On Mon, 23 Oct 2006 10:48:49 -0500, "Nard Moseley \(Digital
  • edited November 2006
    Hi Nard,

    A week ago I posted the following message, but haven't receive dan
    answer yet..

    -------------
    Hi Nard,

    Could you give an estimate when this problem will be tackled?
    Not being able to use another date format other than mm/dd/yyyy is
    hard to explain to a lot of our European customers.

    regards
    Paul

    On Mon, 23 Oct 2006 10:48:49 -0500, "Nard Moseley \(Digital
  • edited November 2006

    I do not have a specific time estimate. This is somthing that we would like
    to improve. The JavaScript Date object is currently be used to parse the
    date string and it does not support date formats. We need to find a new
    approach. I have shared the javscript with some customers that wanted to
    pursue a solution and we are continuing to research it as time allows. I am
    willing to share the current javascript source, if you are interest send an
    email request to support@digital-metaphors.com .


    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.