Commit 3a672c41 authored by Erick Hitter's avatar Erick Hitter

Better handling of empty dates, showing an empty field rather than the...

Better handling of empty dates, showing an empty field rather than the Gregorian equivalent of the Unix epoch.
parent 72fc8396
......@@ -157,8 +157,11 @@ class ETH_Timeline {
*
*/
public function meta_box_dates( $post ) {
$start = (int) get_post_meta( $post->ID, $this->meta_start, true );
$end = (int) get_post_meta( $post->ID, $this->meta_end, true );
$start = get_post_meta( $post->ID, $this->meta_start, true );
$start = is_numeric( $start ) ? (int) $start : '';
$end = get_post_meta( $post->ID, $this->meta_end, true );
$end = is_numeric( $end ) ? (int) $end : '';
?>
<p id="eth-timeline-startbox">
......@@ -188,7 +191,7 @@ class ETH_Timeline {
foreach ( $dates as $key => $date ) {
// Timestamp comes from JS
if ( empty( $date ) )
$timestamp = 0;
$timestamp = false;
else
$timestamp = strtotime( $date );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment