• Resolved dsg257

    (@dsg257)


    has there been any change in the way dates a processed as i have a piece of code in a function that outputs caterories from the calendar onto a page
    this page is updated every 6 months as these events only occur then
    in February they worked fine
    now when i create an event in the calendar they are correct but on the page they are all dated 1st january 1970 but if you click the event the details of the event show up correctly this is the output part of the code

    if ($pg) $url = add_query_arg('page_id',$pg,home_url());
          $op .= "<div id='ae-cat$catid' class='ae-events'>\n";
          $op .= "<div class='ae-catname'>Meetings for $catname</div>\n";
          foreach ($events_in_cat as $annual_event) {
             $op .= "<div class='ae-event'>\n";
             $op .= "<div class='ae-subject'>";
             if ($url) $op .= "<a href='" . add_query_arg('event',$annual_event->eventid,$url) . "' >";
             $op .= $annual_event->subject;
             if ($url) $op .= '</a>';
             $op .= "</div>\n";
             $op .= "<div class='ae-tsfrom'>" . date('F jS, Y',$annual_event->tsfrom) . "</div>\n";
             $op .= "<div class='ae-description'>$annual_event->description</div>\n";
             $op .= "<div class='ae-separator'></div>\n";
             $op .= "</div><!-- End ae-event -->\n";
          }
          $op .= "</div><!-- End ae-events -->\n";

    the output page is at provincial visitations

    can anyone please help
    Read every post in this forum thread and searched wordpress to no avail

    http://wordpress.org/extend/plugins/wp-calendar/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter dsg257

    (@dsg257)

    Noticed that you changed the way the date is handled in version 1.5 how can i change my code to get it to show the proper date instead of 1970
    anyone

    Plugin Author faebu

    (@faebu)

    correct, i do not use timestamps anymore, but mysql datetime fields instead.

    instead of accessing the attribute tsfrom and tsto, you can now access the datetime fields from and to.

    Use the following example to format your date:

    mysql2date($this->date_admin_format, $this->from);

    Have a look at the function mysql2date.

    Thread Starter dsg257

    (@dsg257)

    changing the code from tsfrom To from but all i get is a blank page now changed all occurrences of both tsfrom and tsto to from and to like you suggested but nothing
    The first part of the code that come before the cade pasted above is

    // Shortcode for WP Support scribe257
    // [mm-event catid=7]
    // catid is 5, 6, or 7
    function mm_event_function ($atts) {
       global $wpdb,$mm_events;
    	extract(shortcode_atts(array(
             'catid' => 0,
                                    ), $atts));
    	$op = '';
       if (!$mm_events) {
          $sql = "
             SELECT DISTINCT events.*,cats2.catid
             FROM wp_fsevents events
             JOIN wp_fsevents_cats cats1 ON (events.eventid = cats1.eventid)
             JOIN wp_fsevents_cats cats2 ON (events.eventid = cats2.eventid)
             WHERE cats1.catid = 8
             AND cats2.catid IN (5,6,7)
             ORDER BY tsfrom, tsto";
          $annual_events = $wpdb->get_results($sql);
          // Get events into arrays keyed on [catid]
          foreach ($annual_events as $event) {
             $mm_events["$event->catid"][] = $event;
          }
       }

    i hope this will help solve my problem as i dont understand mysql
    Thanks for a brilliant calendar

    Thread Starter dsg257

    (@dsg257)

    $op .= “<div class=’ae-tsfrom’>” . date(‘F jS, Y’, strtotime($annual_event->from)) . “</div>\n”;

    that fixed it thanks for the work you have done on the pluggin

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: WP Calendar] date format change’ is closed to new replies.