Closed Thread
Page 8 of 9 FirstFirst ... 6 7 8 9 LastLast
Results 71 to 80 of 89

Thread: RoundCube Calendar (jQuery Calendar)

  1. #71
    tjm74 is offline Roundcube Newcomer
    Join Date
    Aug 2008
    Posts
    10
    Downloads
    0
    Uploads
    0

    Cool Daylight Saving bug

    Quote Originally Posted by rosali View Post
    solved

    use that:
    Code:
      function get_events()
      {
        $rcmail = rcmail::get_instance();
    
        $tz = isset($_SESSION['timezone']) ? $_SESSION['timezone'] : date('Z')/3600;
    mmm, not quite. This shifts all events that are not in the current timezone off by one hour -- so if it's july (during daylight saving time) and you're looking back at what happened in january (during which we observed standard time), or vice versa, events look fine in your current month but they are off by an hour during the months where the other tz was observed.

    I have a fix, it's not pretty but it works better. I even try to determine whether DST is not observed where you are (or at least, where the server is, which is usually a good indication).

    1. fix toGMT

    Code:
      function toGMT($time) {
        $gmt_offset = date('Z');
    
        // current gmt offset may not match event's gmt offset
        // adjust accordingly
        if (date('I') && !date('I',$time)) {
          $gmt_offset -= 3600;
        } else if (!date('I') && date('I',$time)) {
          $gmt_offset += 3600;
        }
    
        return date('Y-m-d H:i:s',$time - $gmt_offset);
      }
    2. fix getEvents (in database.php)
    Code:
      public function getEvents($start, $end) {
        if (!empty($this->rcmail->user->ID)) {
    
          /* This was completely wrong -- the question is whether to adjust
             the EVENT's time for DST.
             Whether we are CURRENTLY observing DST is not really the issue.
             The question is (A) does the user observe DST? and if so,
             (B) does THIS EVENT fall on the calendar during DST or STD time?
          */
    
          if ($this->rcmail->config->get('timezone') === "auto") {
            $auto = TRUE;
            $tz = isset($_SESSION['timezone']) ? $_SESSION['timezone'] : date('Z')/3600;
          } else {
            $auto = FALSE;
            $tz = $this->rcmail->config->get('timezone');
            if($this->rcmail->config->get('dst_active')) {
              $dst_active = TRUE;
              $tz++;
            }
          }
    
          if (date('I') || (!$auto && $dst_active)) {
            $tz_std = $tz - 1;
            $tz_dst = $tz;
          } else {
            $tz_std = $tz;
            $tz_dst = $tz + 1;
          }
    
          // Server does not observe DST?  Then most likely the user doesn't either.
          if (($auto || !$dst_active) && !date('I',mktime(0,0,0,7,1,2010))) {
            // no DST adjustment
            $tz_std = $tz;
            $tz_dst = $tz;
          }
    
          $result = $this->rcmail->db->query(
            "SELECT * FROM events
             WHERE user_id=?",
             $this->rcmail->user->ID
           );
    
          $events = array();
          while ($result && ($event = $this->rcmail->db->fetch_assoc($result))) {
            $event['start'] = strtotime($event['start']);
            $event['end'] = strtotime($event['end']);
    
            // is/was the EVENT during daylight saving time?
            if (date('I',$event['start'] + $tz * 3600)) {
              $event['start'] += $tz_dst * 3600;
              $event['end'] += $tz_dst * 3600;
            } else {
              $event['start'] += $tz_std * 3600;
              $event['end'] += $tz_std * 3600;
            }
    
            $events[]=array(
              'id'    => $event['event_id'],
              'start' => date('c', $event['start']),
              'end'   => date('c', $event['end']),
              'title' => $event['summary'],
              'description'  => $event['description'],
              'className'  => $event['category'],
              'allDay'=> ($event['all_day'] == 1)?true:false,
            );
          }
    
          return json_encode($events);
        }
      }

  2. #72
    katie is offline Roundcube Newcomer
    Join Date
    Nov 2009
    Location
    @ keyboard
    Posts
    5
    Downloads
    2
    Uploads
    0

    Default

    Quote Originally Posted by Blueyed1 View Post
    Hi Katie

    Did you ever get it to work?? RC with calendar on postgresSQL ?

    /Blueyed1
    No.

    Makes no sense to hack around at this state.

    Any Ideas?

  3. #73
    Blueyed1 is offline Roundcube Newcomer
    Join Date
    Apr 2010
    Posts
    3
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by katie View Post
    No.

    Makes no sense to hack around at this state.

    Any Ideas?
    It's a pitty that it dosn't work with postgreSQL... I managed to get some tables in the postgreSQL db and I can see/edit them with phpPgAdmin. But I don't know if the tables are correct or what else I need to do. Look at screenshots below.

    rcc1.JPG

    rcc2.JPG

    rcc3.jpg

    rcc4.jpg

    /Blueyed1
    Last edited by Blueyed1; 05-05-2010 at 06:37 PM. Reason: pictures missing

  4. #74
    skaero's Avatar
    skaero is offline Administrator
    Join Date
    Jun 2006
    Location
    USA - New Mexico
    Posts
    2,092
    Downloads
    5
    Uploads
    0

    Default

    Assuming the database is setup correctly you would need to edit the sql querys that are going to the database that are in the main plugin file.

  5. #75
    Blueyed1 is offline Roundcube Newcomer
    Join Date
    Apr 2010
    Posts
    3
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by skaero View Post
    Assuming the database is setup correctly you would need to edit the sql querys that are going to the database that are in the main plugin file.
    Well, my knowledge to postgresSQL DB and configuration in general, is limited to following a step by step guide.

    It would be a nice feature if calendar plugin could be made so it'l run on postgresSQL, the same way as mySQL, and with a brief guide to installation.

    /Blueyed1

  6. #76
    rosali's Avatar
    rosali is offline Super Moderator
    Join Date
    Dec 2007
    Location
    Germany
    Posts
    2,394
    Downloads
    36
    Uploads
    0

    Default

    This thread has been splitted to:

    #1-jQuery Weekcalendar plugin (deprecated)
    http://www.roundcubeforum.net/7-thir...eprecated.html

    #2-jQuery Fullcalendar plugin (developed by Lazlo and forked by rosali)
    http://www.roundcubeforum.net/7-thir...ed-rosali.html

    Posts regarding these two plugin versions has been moved to appriate thread.

    Posts remaining here refer to Lazlo's Github version (RoundCube Calendar).
    Last edited by rosali; 05-31-2010 at 04:01 PM.
    Regards,
    Rosali

    __________________
    MyRoundcube Project http://myroundcube.googlecode.com
    MyRoundcube Online Demo - Free Email Address http://mail4us.net
    MyRoundcube Plugins Generic Installation Guide http://mail4us.net/myroundcube/index.php
    Mailing List http://mail4us.net/?_action=plugin.nabble

  7. #77
    rosali's Avatar
    rosali is offline Super Moderator
    Join Date
    Dec 2007
    Location
    Germany
    Posts
    2,394
    Downloads
    36
    Uploads
    0

    Default

    @ all subscribers: Don't miss to subscribe to new threads!
    Regards,
    Rosali

    __________________
    MyRoundcube Project http://myroundcube.googlecode.com
    MyRoundcube Online Demo - Free Email Address http://mail4us.net
    MyRoundcube Plugins Generic Installation Guide http://mail4us.net/myroundcube/index.php
    Mailing List http://mail4us.net/?_action=plugin.nabble

  8. #78
    trvsfhln is offline Roundcube Newcomer
    Join Date
    Jun 2010
    Posts
    6
    Downloads
    0
    Uploads
    0

    Default How do I change the hours

    How do I change the hours to AM and PM 12 hour blocks instead of the 24:00 clock

  9. #79
    dziobak is offline Registered User
    Join Date
    Dec 2009
    Location
    Poland
    Posts
    184
    Downloads
    4
    Uploads
    0

    Default

    you can do it i calendar settings: change time format....

  10. #80
    trvsfhln is offline Roundcube Newcomer
    Join Date
    Jun 2010
    Posts
    6
    Downloads
    0
    Uploads
    0

    Default Categories

    How do I add and create new categories in the calendar

Closed Thread
Page 8 of 9 FirstFirst ... 6 7 8 9 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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