<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%Links::Config::load_vars%>
<html>

<head>
  <title>Gossamer Links Setup: Date Options</title>
  <%include include_style.html%>

  <script type="text/javascript">
    function cancelEvent (e) {
      if (!e && window.event)
        e = window.event;
      if (e) {
        e.returnValue = false;
        e.cancelBubble = true;
      }
      return false;
    }
  </script>
</head>

<body>

<form method="post" action="setup.cgi">
<input type="hidden" name="do" value="setup_date" />

<%set header_title = 'Date Options'%>
<%set header_details = 'These settings control how dates are displayed in the
user side of Gossamer Links.<br /><br />
<a id="ahelp" href="admin.cgi?page=setup_date.html;help='%>
<%if help%><%set header_details .= '0">Hide'%><%else%><%set header_details .= '1">Show'%><%endif%>
<%set header_details .= '</a> date format help.'%>
<%include include_header.html%>

<script type="text/javascript">
  var ahelp = document.getElementById('ahelp');
  var shown = false;
  ahelp.onclick = function (e) {
    while (ahelp.childNodes.length > 0) ahelp.removeChild(ahelp.childNodes[0]);
    var text, help, display;
    if (shown) {
      text = 'Show';
      help = '1';
      display = 'none';
    }
    else {
      text = 'Hide';
      help = '0';
      display = 'block';
    }
    ahelp.appendChild(document.createTextNode(text));
    ahelp.href = 'admin.cgi?page=setup_date.html;help=' + help;
    document.getElementById('help').style.display = display;
    shown = !shown;
    return cancelEvent(e);
  };
</script>

<table id="help"<%unless help%> style="display: none"<%endunless%>>
  <tr>
    <th class="heading" colspan="2">Date Format Help</th>
  </tr>
  <tr>
    <td class="description" colspan="2">
      You can change the format of any dates displayed to the user using these
      settings.  The following date formats are supported:
    </td>
  </tr>
  <tr>
    <td class="setting">%yyyy%</td>
    <td class="value">Four-digit year such as 2004</td>
  </tr>
  <tr>
    <td class="setting">%yy%</td>
    <td class="value">Two-digit year such as 04</td>
  </tr>
  <tr>
    <td class="setting">%mmmm%</td>
    <td class="value">Long month name such as January</td>
  </tr>
  <tr>
    <td class="setting">%mmm%</td>
    <td class="value">Short month name such as Jan</td>
  </tr>
  <tr>
    <td class="setting">%mm%</td>
    <td class="value">Numerical month such as 01</td>
  </tr>
  <tr>
    <td class="setting">%m%</td>
    <td class="value">Numerical month without leading 0, such as 1</td>
  </tr>
  <tr>
    <td class="setting">%dddd%</td>
    <td class="value">Long weekday name such as Sunday</td>
  </tr>
  <tr>
    <td class="setting">%ddd%</td>
    <td class="value">Short weekday name such as Sun</td>
  </tr>
  <tr>
    <td class="setting">%dd%</td>
    <td class="value">Numerical date such as 09</td>
  </tr>
  <tr>
    <td class="setting">%d%</td>
    <td class="value">Numerical date without leading 0, such as 9</td>
  </tr>
  <tr>
    <th class="heading" colspan="2">Example Formats</th>
  </tr>
  <tr>
    <td class="setting">%yyyy%-%mm%-%dd%</td>
    <td class="value">1999-12-25</td>
  </tr>
  <tr>
    <td class="setting">%dd%-%mmm%-%yyyy%</td>
    <td class="value">12-Dec-1999</td>
  </tr>
  <tr>
    <td class="setting"><nobr>%ddd% %mmm% %dd% %yyyy%</nobr></td>
    <td class="value">Sat Dec 12 1999</td>
  </tr>
</table>

<table>
  <tr>
    <th class="heading" colspan="2">Date Options:</th>
  </tr>
  <tr>
    <td class="description" colspan="2">
      User date format. This should be how you want the user to see your dates.
    </td>
  </tr>
  <tr>
    <td class="option">date_user_format</td>
    <td class="value"><input type="text" name="date_user_format" value="<%cfg_date_user_format%>" size="40" /></td>
  </tr>
  <tr>
    <td class="description" colspan="2">
      Expiry date format. This should be how you want the expiry date to be
      displayed.
    </td>
  </tr>
  <tr>
    <td class="option">date_expiry_format</td>
    <td class="value"><input type="text" name="date_expiry_format" value="<%cfg_date_expiry_format%>" size="40" /></td>
  </tr>
  <tr>
    <td class="description" colspan="2">
      Review date format. This is the format used to display review dates.
    </td>
  </tr>
  <tr>
    <td class="option">date_review_format</td>
    <td class="value"><input type="text" name="date_review_format" value="<%cfg_date_review_format%>" size="40" /></td>
  </tr>
  <tr>
    <td class="description" colspan="2">
      Long user date format. This should be how you want the user to see long
      dates.
    </td>
  </tr>
  <tr>
    <td class="option">date_long_format</td>
    <td class="value"><input type="text" name="date_long_format" value="<%cfg_date_long_format%>" size="40" /></td>
  </tr>
  <tr>
    <td class="description" colspan="2">
      Date offset. How many hours to offset the date from your web server to
      your local time.
    </td>
  </tr>
  <tr>
    <td class="option">date_offset</td>
    <td class="value"><input type="text" name="date_offset" value="<%cfg_date_offset%>" size="10" /></td>
  </tr>
  <tr>
    <td class="description" colspan="2">
      Short day names (comma separated list).
    </td>
  </tr>
  <tr>
    <td class="option">date_days_short</td>
    <td class="value"><input type="text" name="date_days_short" value="<%cfg_date_days_short%>" size="40" /></td>
  </tr>
  <tr>
    <td class="description" colspan="2">
      Long day names (comma separated list).
    </td>
  </tr>
  <tr>
    <td class="option">date_days_long</td>
    <td class="value"><input type="text" name="date_days_long" value="<%cfg_date_days_long%>" size="40" /></td>
  </tr>
  <tr>
    <td class="description" colspan="2">
      Short month names (comma separated list).
    </td>
  </tr>
  <tr>
    <td class="option">date_month_short</td>
    <td class="value"><input type="text" name="date_month_short" value="<%cfg_date_month_short%>" size="40" /></td>
  </tr>
  <tr>
    <td class="description" colspan="2">
      Long month names (comma separated list).
    </td>
  </tr>
  <tr>
    <td class="option">date_month_long</td>
    <td class="value"><input type="text" name="date_month_long" value="<%cfg_date_month_long%>" size="40" /></td>
  </tr>
</table>

<div class="submit">
  <input type="submit" value="Submit Changes" />
  <input type="submit" name="reset_defaults" value="Restore System Defaults" />
</div>

</form>
</body>
</html>
