Document remaining time format options

This commit is contained in:
JonnyWong16 2016-03-01 20:31:21 -08:00
parent 2afca9f2b4
commit 0e2504fc78
3 changed files with 208 additions and 52 deletions

View file

@ -2656,6 +2656,7 @@ table[id^='media_info_child'] table[id^='media_info_child'] thead th {
margin: 5px 0 0 0.5em; margin: 5px 0 0 0.5em;
} }
.notification-params { .notification-params {
width: 100%;
margin-top: 10px; margin-top: 10px;
background-color: #282828; background-color: #282828;
} }
@ -2670,6 +2671,14 @@ table[id^='media_info_child'] table[id^='media_info_child'] thead th {
padding-left: 10px; padding-left: 10px;
width: 200px; width: 200px;
} }
.notification-params.time-options td:first-child {
padding-left: 10px;
width: 125px;
}
.notification-params.time-options td:nth-child(2) {
padding-left: 10px;
width: 275px;
}
.notification-params td:not(:first-child) { .notification-params td:not(:first-child) {
padding-right: 10px; padding-right: 10px;
} }

View file

@ -1031,24 +1031,45 @@ available_notification_agents = sorted(notifiers.available_notification_agents()
<h4 class="modal-title">Date &amp; Time Format Options</h4> <h4 class="modal-title">Date &amp; Time Format Options</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<table> <table class="notification-params time-options">
<thead>
<tr>
<th>
Year
</th>
</tr>
</thead>
<tbody> <tbody>
<tr>
<td align="center" colspan="3"><h5>Year</h5></td>
</tr>
<tr> <tr>
<td><strong>YYYY</strong></td> <td><strong>YYYY</strong></td>
<td>Numeric, 4 digits</td> <td>Numeric, four digits</td>
<td>Eg., 1999, 2003</td> <td>Eg., 1999, 2003</td>
</tr> </tr>
<tr> <tr>
<td><strong>YY</strong></td> <td><strong>YY</strong></td>
<td>Numeric, 2 digits</td> <td>Numeric, two digits</td>
<td>Eg., 99, 03</td> <td>Eg., 99, 03</td>
</tr> </tr>
</tbody>
</table>
<table class="notification-params time-options">
<thead>
<tr> <tr>
<td align="center" colspan="3"><h5>Month</h5></td> <th>
Month
</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>MMMM</strong></td>
<td>Textual, full</td>
<td>January-December</td>
</tr>
<tr>
<td><strong>MMM</strong></td>
<td>Textual, three letters</td>
<td>Jan-Dec</td>
</tr> </tr>
<tr> <tr>
<td><strong>MM</strong></td> <td><strong>MM</strong></td>
@ -1060,23 +1081,41 @@ available_notification_agents = sorted(notifiers.available_notification_agents()
<td>Numeric, without leading zeros</td> <td>Numeric, without leading zeros</td>
<td>1-12</td> <td>1-12</td>
</tr> </tr>
</tbody>
</table>
<table class="notification-params time-options">
<thead>
<tr> <tr>
<td><strong>MMMM</strong></td> <th>
<td>Textual full</td> Day of the Year
<td>January-December</td> </th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>DDDD</strong></td>
<td>Numeric, with leading zeros</td>
<td>001-365</td>
</tr> </tr>
<tr> <tr>
<td><strong>MMM</strong></td> <td><strong>DDD</strong></td>
<td>Textual three letters</td> <td>Numeric, without leading zeros</td>
<td>Jan-Dec</td> <td>1-365</td>
</tr> </tr>
</tbody>
</table>
<table class="notification-params time-options">
<thead>
<tr> <tr>
<td align="center" colspan="3"><h5>Day</h5></td> <th>
Day of the Month
</th>
</tr> </tr>
</thead>
<tbody>
<tr> <tr>
<td width="100"><strong>DD</strong></td> <td><strong>DD</strong></td>
<td width="300">Numeric, with leading zeros</td> <td>Numeric, with leading zeros</td>
<td>01-31</td> <td>01-31</td>
</tr> </tr>
<tr> <tr>
@ -1086,57 +1125,165 @@ available_notification_agents = sorted(notifiers.available_notification_agents()
</tr> </tr>
<tr> <tr>
<td><strong>Do</strong></td> <td><strong>Do</strong></td>
<td>The English suffix for the day of the month</td> <td>Numeric, with suffix</td>
<td>st, nd or th in the 1st, 2nd or 15th.</td> <td>Eg., 1st, 2nd ... 31st.</td>
</tr> </tr>
</tbody>
</table>
<table class="notification-params time-options">
<thead>
<tr> <tr>
<td align="center" colspan="3"><h5>Time</h5></td> <th>
Day of the Week
</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>dddd</strong></td>
<td>Textual, full</td>
<td>Sunday-Saturday</td>
</tr> </tr>
<tr> <tr>
<td><strong>a</strong></td> <td><strong>ddd</strong></td>
<td width="300">am/pm Lowercase</td> <td>Textual, three letters</td>
<td>am, pm</td> <td>Sun-Sat</td>
</tr> </tr>
<tr> <tr>
<td><strong>A</strong></td> <td><strong>d</strong></td>
<td>AM/PM Uppercase</td> <td>Numeric</td>
<td>AM, PM</td> <td>0-6</td>
</tr> </tr>
</tbody>
</table>
<table class="notification-params time-options">
<thead>
<tr> <tr>
<td><strong>h</strong></td> <th>
<td>Hour, 12-hour, without leading zeros</td> Hour
<td>1-12</td> </th>
</tr>
<tr>
<td><strong>hh</strong></td>
<td>Hour, 12-hour, with leading zeros</td>
<td>01-12</td>
</tr>
<tr>
<td><strong>H</strong></td>
<td>Hour, 24-hour, without leading zeros</td>
<td>0-23</td>
</tr> </tr>
</thead>
<tbody>
<tr> <tr>
<td><strong>HH</strong></td> <td><strong>HH</strong></td>
<td>Hour, 24-hour, with leading zeros</td> <td>24-hour, with leading zeros</td>
<td>00-23</td> <td>00-23</td>
</tr> </tr>
<tr>
<td><strong>H</strong></td>
<td>24-hour, without leading zeros</td>
<td>0-23</td>
</tr>
<tr>
<td><strong>hh</strong></td>
<td>12-hour, with leading zeros</td>
<td>01-12</td>
</tr>
<tr>
<td><strong>h</strong></td>
<td>12-hour, without leading zeros</td>
<td>1-12</td>
</tr>
</tbody>
</table>
<table class="notification-params time-options">
<thead>
<tr>
<th>
Minute
</th>
</tr>
</thead>
<tbody>
<tr> <tr>
<td><strong>mm</strong></td> <td><strong>mm</strong></td>
<td>Minutes, with leading zeros</td> <td>Numeric, with leading zeros</td>
<td>00-59</td> <td>00-59</td>
</tr> </tr>
<tr>
<td><strong>m</strong></td>
<td>Numeric, without leading zeros</td>
<td>0-59</td>
</tr>
</tbody>
</table>
<table class="notification-params time-options">
<thead>
<tr>
<th>
Second
</th>
</tr>
</thead>
<tbody>
<tr> <tr>
<td><strong>ss</strong></td> <td><strong>ss</strong></td>
<td>Seconds, with leading zeros</td> <td>Numeric, with leading zeros</td>
<td>00-59</td> <td>00-59</td>
</tr> </tr>
<tr> <tr>
<td><strong>zz</strong></td> <td><strong>s</strong></td>
<td>Timezone abbreviation</td> <td>Numeric, without leading zeros</td>
<td>Eg., EST, MDT ...</td> <td>0-59</td>
</tr>
</tbody>
</table>
<table class="notification-params time-options">
<thead>
<tr>
<th>
AM / PM
</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>A</strong></td>
<td>AM/PM uppercase</td>
<td>AM, PM</td>
</tr>
<tr>
<td><strong>a</strong></td>
<td width="300">am/pm lowercase</td>
<td>am, pm</td>
</tr>
</tbody>
</table>
<table class="notification-params time-options">
<thead>
<tr>
<th>
Timezone
</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>ZZ</strong></td>
<td>UTC offset</td>
<td>Eg., +0100, -0700</td>
</tr>
<tr>
<td><strong>Z</strong></td>
<td>UTC offset</td>
<td>Eg., +01:00, -07:00</td>
</tr>
</tbody>
</table>
<table class="notification-params time-options">
<thead>
<tr>
<th>
Timestamp
</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>X</strong></td>
<td>Unix timestamp</td>
<td>Eg., 1456887825</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View file

@ -441,9 +441,9 @@ def set_notify_state(session, notify_action, agent_info, notify_strings, metadat
def build_notify_text(session=None, timeline=None, notify_action=None, agent_id=None): def build_notify_text(session=None, timeline=None, notify_action=None, agent_id=None):
# Get time formats # Get time formats
date_format = plexpy.CONFIG.DATE_FORMAT.replace('Do','').replace('zz','') date_format = plexpy.CONFIG.DATE_FORMAT.replace('Do','')
time_format = plexpy.CONFIG.TIME_FORMAT.replace('Do','').replace('zz','') time_format = plexpy.CONFIG.TIME_FORMAT.replace('Do','')
duration_format = plexpy.CONFIG.TIME_FORMAT.replace('Do','').replace('zz','').replace('a','').replace('A','') duration_format = plexpy.CONFIG.TIME_FORMAT.replace('Do','').replace('a','').replace('A','')
# Get the server name # Get the server name
server_name = plexpy.CONFIG.PMS_NAME server_name = plexpy.CONFIG.PMS_NAME
@ -900,8 +900,8 @@ def build_notify_text(session=None, timeline=None, notify_action=None, agent_id=
def build_server_notify_text(notify_action=None, agent_id=None): def build_server_notify_text(notify_action=None, agent_id=None):
# Get time formats # Get time formats
date_format = plexpy.CONFIG.DATE_FORMAT.replace('Do','').replace('zz','') date_format = plexpy.CONFIG.DATE_FORMAT.replace('Do','')
time_format = plexpy.CONFIG.TIME_FORMAT.replace('Do','').replace('zz','') time_format = plexpy.CONFIG.TIME_FORMAT.replace('Do','')
# Get the server name # Get the server name
server_name = plexpy.CONFIG.PMS_NAME server_name = plexpy.CONFIG.PMS_NAME