/** * Builds the file name for the zip * Uses the print issue title & day/time * * @uses get_timezone * * @return string The zip file name */ function get_zip_file_name() { date_default_timezone_set(Core\get_timezone()); return sprintf(__('Issue %1$s exported on %2$s at %3$s', 'eight-day-week'), $this->issue_title, date('m-d-y'), date('h:ia')); }
/** * Builds the export status string * * @param int $article_id The article post ID * * @return string The export status */ function get_export_status($article_id) { $timestamp = get_post_meta($article_id, 'export_status_timestamp', true); if (!$timestamp) { return false; } $user_id = get_post_meta($article_id, 'export_status_user_id', true); $user = get_user_by('id', absint($user_id)); $zone = new \DateTimeZone(Core\get_timezone()); $export_datetime = new \DateTime('now', $zone); $export_datetime->setTimestamp($timestamp); $now = new \DateTime('now', $zone); $not_today = $export_datetime->diff($now)->format("%R%a"); if (!$not_today) { $export_status = sprintf(__('Exported on %1$s by %2$s', 'eight-day-week'), $export_datetime->format(get_option('date_format')), $user->display_name); } else { $export_status = sprintf(__('Exported at %1$s by %2$s', 'eight-day-week'), $export_datetime->format(_x('g:ia', 'Format for article export timestamp', 'eight-day-week')), $user->display_name); } return $export_status; }