Browse Source

format dates as ISO8601 instead of english text

master
Aaron Parecki 6 years ago
parent
commit
3ee6a22e63
6 changed files with 28 additions and 15 deletions
  1. +13
    -0
      lib/helpers.php
  2. +1
    -1
      public/css/style.css
  3. BIN
      public/images/switchboard-logo.png
  4. BIN
      public/images/switchboard-logo.psd
  5. +7
    -7
      views/feed-status.php
  6. +7
    -7
      views/subscription-status.php

+ 13
- 0
lib/helpers.php View File

@ -23,6 +23,19 @@ function friendly_date($date_string, $tz_offset) {
return $date->format('F j, Y H:i:s') . ' ' . $tz;
}
function format_date($date_string, $tz_offset) {
if(!$date_string)
return '';
$date = new DateTime($date_string);
if($tz_offset > 0)
$date->add(new DateInterval('PT'.$tz_offset.'S'));
elseif($tz_offset < 0)
$date->sub(new DateInterval('PT'.abs($tz_offset).'S'));
$tz = ($tz_offset < 0 ? '-' : '+') . sprintf('%02d:%02d', abs($tz_offset/60/60), ($tz_offset/60)%60);
return $date->format('Y-m-d H:i:s') . ' ' . $tz;
}
function build_url($parsed_url) {
$scheme = isset($parsed_url['scheme']) ? $parsed_url['scheme'] . '://' : '';
$host = isset($parsed_url['host']) ? $parsed_url['host'] : '';

+ 1
- 1
public/css/style.css View File

@ -26,7 +26,6 @@ body.logged-out {
}
.narrow {
background: #fff;
max-width: 700px;
margin-right: auto;
margin-left: auto;
@ -65,6 +64,7 @@ body.logged-out {
}
.subscription-status, .feed-status {
background: #fff;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;

BIN
public/images/switchboard-logo.png View File

Before After
Width: 1024  |  Height: 1024  |  Size: 57 KiB Width: 512  |  Height: 512  |  Size: 48 KiB

BIN
public/images/switchboard-logo.psd View File


+ 7
- 7
views/feed-status.php View File

@ -1,4 +1,4 @@
<?php $tz = -7 * 3600; ?>
<?php $tz = 0; ?>
<div class="narrow subscription-status">
<h3>Feed Status</h3>
@ -9,11 +9,11 @@
</tr>
<tr>
<td>Last Ping Received</td>
<td><?= friendly_date($this->feed->push_last_ping_received, $tz) ?></td>
<td><?= format_date($this->feed->push_last_ping_received, $tz) ?></td>
</tr>
<tr>
<td>Last Retrieved</td>
<td><?= friendly_date($this->feed->last_retrieved, $tz) ?></td>
<td><?= format_date($this->feed->last_retrieved, $tz) ?></td>
</tr>
</table>
@ -32,19 +32,19 @@
</tr>
<tr>
<td>Date Subscribed</td>
<td><?= friendly_date($subscriber->date_created, $tz) ?></td>
<td><?= format_date($subscriber->date_created, $tz) ?></td>
</tr>
<tr>
<td>Last Confirmed</td>
<td><?= friendly_date($subscriber->date_confirmed, $tz) ?></td>
<td><?= format_date($subscriber->date_confirmed, $tz) ?></td>
</tr>
<tr>
<td>Date Expires</td>
<td><?= friendly_date($subscriber->date_expires, $tz) ?></td>
<td><?= format_date($subscriber->date_expires, $tz) ?></td>
</tr>
<tr>
<td>Last Ping Sent</td>
<td><?= friendly_date($subscriber->date_last_ping_sent, $tz) ?></td>
<td><?= format_date($subscriber->date_last_ping_sent, $tz) ?></td>
</tr>
<tr>
<td>Last Response<br>(from subscriber)</td>

+ 7
- 7
views/subscription-status.php View File

@ -1,4 +1,4 @@
<?php $tz = -7 * 3600; ?>
<?php $tz = 0; ?>
<div class="narrow subscription-status">
<? if($this->subscription->active): ?>
@ -19,7 +19,7 @@
</tr>
<tr>
<td>Date Subscription was Requested</td>
<td><?= friendly_date($this->subscription->date_requested, $tz) ?></td>
<td><?= format_date($this->subscription->date_requested, $tz) ?></td>
</tr>
<tr>
<td>Subscription Verification Response<br>(from your server)</td>
@ -27,18 +27,18 @@
</tr>
<tr>
<td>Date Subscription was Confirmed</td>
<td><?= friendly_date($this->subscription->date_confirmed, $tz) ?></td>
<td><?= format_date($this->subscription->date_confirmed, $tz) ?></td>
</tr>
<? if($this->subscription->date_unsubscribed): ?>
<tr>
<td>Date Unsubscribed</td>
<td><?= friendly_date($this->subscription->date_unsubscribed, $tz) ?></td>
<td><?= format_date($this->subscription->date_unsubscribed, $tz) ?></td>
</tr>
<? endif; ?>
<? if($this->subscription->date_expires): ?>
<tr>
<td>Subscription Expiration</td>
<td><?= friendly_date($this->subscription->date_expires, $tz) ?></td>
<td><?= format_date($this->subscription->date_expires, $tz) ?></td>
</tr>
<? endif; ?>
@ -48,11 +48,11 @@
<table class="table">
<tr>
<td>Last ping received from publisher</td>
<td><?= friendly_date($this->feed->push_last_ping_received, $tz) ?></td>
<td><?= format_date($this->feed->push_last_ping_received, $tz) ?></td>
</tr>
<tr>
<td>Last ping sent to subscriber</td>
<td><?= friendly_date($this->subscription->date_last_ping_sent, $tz) ?></td>
<td><?= format_date($this->subscription->date_last_ping_sent, $tz) ?></td>
</tr>
<tr>
<td>Last Response<br>(from your server)</td>

Loading…
Cancel
Save