Results 1 to 3 of 3

Thread: Extract date format of web root page

  1. #1
    New user
    Join Date
    06-16-11.
    Posts
    3

    Default Extract date format of web root page

    Hi All,

    I've got xdependentcalendarfields module installed that I use for reservations form on my multilingual website. Each language version of the website has it's webroot page and each webroot page has it's date format set to the one used in that language.

    xdependentcalendarfields uses
    Code:
    $dateFormat = strlen($this->xdateformat) ? $this->xdateformat : $GLOBALS['TL_CONFIG']['dateFormat'];
    to get date format from global system settings and then uses that format to validate dates in the form.

    Issue here is provided that my date format in system is set to British format and English website has the same settings - date will validate, however if my Lithuanian version has date format set to LT version and system settings are British - date will be invalid on the form in Lithuanian version of the website.

    Is there a way to read the date format set to a root of the website, instead of the global system settings?

  2. #2
    User Andreas's Avatar
    Join Date
    07-11-09.
    Location
    Mönchengladbach
    Posts
    499

    Default Re: Extract date format of web root page

    $GLOBALS['objPage']->dateFormat
    Web-Development, Freelancer, Burgtech, XHTML, HTML5, CSS, PHP, Javascript, MooTools, MySQL and more
    Amazon wishlist

  3. #3
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: Extract date format of web root page

    or you can use a similar code:

    Code:
    global $objPage;
    echo $objPage->dateFormat;

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •