Changeset 11097
- Timestamp:
- 09/13/2016 09:14:06 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-functions.php
r11088 r11097 1309 1309 } 1310 1310 1311 $date = new DateTime( $timestamp, new DateTimeZone( 'UTC' ) ); 1311 try { 1312 $date = new DateTime( $timestamp, new DateTimeZone( 'UTC' ) ); 1313 1314 // Not a valid date, so return blank string. 1315 } catch( Exception $e ) { 1316 return ''; 1317 } 1318 1312 1319 return $date->format( DateTime::ISO8601 ); 1313 1320 } -
trunk/tests/phpunit/testcases/core/functions.php
r11082 r11097 254 254 255 255 $this->assertEquals( 'March 18, 2014 at 7:00 pm', bp_format_time( $time, $just_date, $localize_time ) ); 256 } 257 258 /** 259 * @group bp_core_get_iso8601_date 260 */ 261 public function test_bp_core_get_iso8601_date_invalid_date() { 262 $this->assertEquals( '', bp_core_get_iso8601_date( 'Not a date' ) ); 256 263 } 257 264
Note: See TracChangeset
for help on using the changeset viewer.