We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38401
    • 15 Posts
    I have a website with three languages​​:
    - Context web ==> French
    - Context en ==> English
    - Context es ==> Spanish

    Multilingualism is managed by the MODx extra Babel.

    Only the English context calendar is good.

    The French and Spanish displays a calendar starting January 1 regardless of the selected month and events are not displayed.

    See the attachment for the rendering of three calendars… [ed. note: xman75 last edited this post 12 years ago.]
    • can you turn on debug for the calendar and then send me all the extra output it renders; this should include an select statement. To enable debugging you can quickly add a parameter &debut=`1` to the snippet call.

      Cheers
        Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
        Visit CharlesMx.com for latest news and status updates.
        • 38401
        • 15 Posts
        CALENDAR ES

        Filtering calendar date SQL range with: 01/01/1970 through 02/12/1970
        
        SQL: SELECT mxCalendarEvents.*, CategoryId.name AS category, CategoryId.foregroundcss,
        CategoryId.backgroundcss, CategoryId.inlinecss FROM `modx_mxcalendars_events` AS
        `mxCalendarEvents` JOIN `modx_mxcalendars_categories` `CategoryId` ON
        `mxCalendarEvents`.`categoryid` = `CategoryId`.`id` WHERE ( ( `mxCalendarEvents`.`repeating` = 0
        AND `mxCalendarEvents`.`enddate` >= 0 AND `mxCalendarEvents`.`enddate` <= 3628800 OR (
        `mxCalendarEvents`.`repeating` = 1 AND `mxCalendarEvents`.`repeatenddate` >= 0 ) ) AND
        `mxCalendarEvents`.`context` IN ('','es') ) ORDER BY name DESC LIMIT 99 
        
        
        Returned Events: 0
        No valid dates returned.
        mxCalendar processed in 0,129429101944 seconds




        CALENDAR EN

        Filtering calendar date SQL range with: 04/01/2012 through 05/13/2012
        
        SQL: SELECT mxCalendarEvents.*, CategoryId.name AS category, CategoryId.foregroundcss,
        CategoryId.backgroundcss, CategoryId.inlinecss FROM `modx_mxcalendars_events` AS
        `mxCalendarEvents` JOIN `modx_mxcalendars_categories` `CategoryId` ON
        `mxCalendarEvents`.`categoryid` = `CategoryId`.`id` WHERE ( ( `mxCalendarEvents`.`repeating` = 0
        AND `mxCalendarEvents`.`enddate` >= 1333231201 AND `mxCalendarEvents`.`enddate` <=
        1336860001 OR ( `mxCalendarEvents`.`repeating` = 1 AND `mxCalendarEvents`.`repeatenddate` >=
        1333231201 ) ) AND `mxCalendarEvents`.`context` IN ('','en') ) ORDER BY name DESC LIMIT 99 
        
        
        Returned Events: 1
        Looping through events list of 1 total.
            1) 2012-04-23 1
        
        mxCalendar processed in 0.169291973114 seconds

        • Are the snippet calls the same for both context? If so can you past the one used on the ES site, please. The ES call appears to be getting invalid dates for some reason, that's why I ask.

          Cheers
            Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
            Visit CharlesMx.com for latest news and status updates.
            • 38401
            • 15 Posts
            The call is very simple. It's the same for each context :
            [[!mxcalendar? &theme=`default`]]
            • Can you provide me with some more information about your setup? (os, web server, PHP version, etc.) I'm still not able to duplicate this issue at this time.

              Can you try to add in the actual parameters to set the dates in the snippet call and see if that makes it work? This shouldn't make any difference especially since it's the calendar view, but worth checking.

              [[!mxcalendar? &theme=`default` &elStartDate=`now` &elEndDate=`next month`]]


              Cheers
                Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
                Visit CharlesMx.com for latest news and status updates.
                • 38401
                • 15 Posts
                No change…

                I think if you change your SETLOCAL, you'll reproduce the bug.
                The problem is partly solved by changing the code:
                //$startDOW = $this->dowMatch[strftime('%a', strtotime($mStartDate))];
                // Modified by xman75
                $startDOW = (int)strftime('%w', strtotime($mStartDate));
                if ($startDOW == 0) $startDOW = 7;
                

                There is probably also a problem in this part of code:
                public function getFormatedDate($f,$t){
                return str_replace('%O', date('S', $t),strftime($f,$t));
                }
                

                Thanks for your help [ed. note: xman75 last edited this post 12 years ago.]
                • What is your local and I'll test, also note that a new release was just published last night as well.

                  cheers
                    Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
                    Visit CharlesMx.com for latest news and status updates.
                    • 38401
                    • 15 Posts
                    The problem remains

                    setlocale (LC_ALL, "fr_FR");

                    Cheers for getting back to me so quickly [ed. note: xman75 last edited this post 12 years ago.]
                      • 38401
                      • 15 Posts
                      Could you reproduce the problem?
                      To be more specific here is the plugin I use to manage setlocal (OnInitCulture System Events checked):

                      <?php
                      if($_GET['cultureKey'] == "") {
                          setlocale(LC_ALL, 'fr_FR.UTF-8');
                      }
                      if($_GET['cultureKey'] == "pt") {
                          setlocale(LC_ALL, 'pt_BR.UTF-8');
                      }
                      if($_GET['cultureKey'] == "ru") {
                          setlocale(LC_ALL, 'ru_RU.UTF-8');
                      }
                      if($_GET['cultureKey'] == "en") {
                          setlocale(LC_ALL, 'en_US.UTF-8');
                      }
                      if($_GET['cultureKey'] == "es") {
                          setlocale(LC_ALL, 'es_ES.UTF-8');
                      }