Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/09/2011 05:47:59 PM (14 years ago)
Author:
boonebgorges
Message:

Switches date picker xprofile fields to save in MySQL date format rather than UNIX timestamp, to prevent problems with UNIX epoch. Fixes #2240. Props cnorris23, r-a-y

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-xprofile/bp-xprofile-template.php

    r5045 r5131  
    570570
    571571                if ( !empty( $date ) ) {
    572                     $day   = date( 'j', $date );
    573                     $month = date( 'F', $date );
    574                     $year  = date( 'Y', $date );
     572                    // If Unix timestamp
     573                    if ( is_numeric( $date ) ) {
     574                        $day   = date( 'j', $date );
     575                        $month = date( 'F', $date );
     576                        $year  = date( 'Y', $date );
     577
     578                    // If MySQL timestamp
     579                    } else {
     580                        $day   = mysql2date( 'j', $date );
     581                        $month = mysql2date( 'F', $date );
     582                        $year  = mysql2date( 'Y', $date );
     583                    }
    575584                }
    576585
Note: See TracChangeset for help on using the changeset viewer.