File: time.inc

package info (click to toggle)
horde3 3.1.3-4etch7
  • links: PTS
  • area: main
  • in suites: etch
  • size: 22,876 kB
  • ctags: 18,071
  • sloc: php: 75,151; xml: 2,979; sql: 1,069; makefile: 79; sh: 64
file content (32 lines) | stat: -rw-r--r-- 1,119 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
$i = 0;
while ($i <= count($date['values']) && empty($date['values'][$i])) {
    $i++;
}
if (strpos($date['values'][$i], ':') !== false) {
    $del = ':';
} elseif (strpos($date['values'][$i], '.') !== false) {
    $del = '.';
} else {
    $del = '';
}
$ampm = (strpos(String::lower($date['values'][0]), 'am') !== false || strpos(String::lower($date['values'][0]), 'pm') !== false);
?>
<tr>
  <td><?php echo _("Select the time delimiter:") ?></td>
  <td>
    <select name="delimiter[<?php echo htmlspecialchars($key) ?>]">
      <option value=":"<?php echo $del == ':' ? ' selected="selected"' : '' ?>>:</option>
      <option value="."<?php echo $del == '.' ? ' selected="selected"' : '' ?>>.</option>
    </select>
  </td>
</tr>
<tr>
  <td><?php echo _("Select the time format:") ?></td>
  <td>
    <select name="format[<?php echo htmlspecialchars($key) ?>]">
      <option value="24hr"<?php echo $ampm ? '' : ' selected="selected"' ?>><?php echo _("24 hours") ?></option>
      <option value="ampm"<?php echo $ampm ? ' selected="selected"' : '' ?>><?php echo _("AM/PM") ?></option>
    </select>
  </td>
</tr>