Example #1
0
 protected function formatLongYear()
 {
     if ($this->y < 0) {
         return WT_I18N::translate('%s&nbsp;BCE', WT_I18N::digits(-$this->y));
     } else {
         if ($this->new_old_style) {
             return WT_I18N::translate('%s&nbsp;CE', WT_I18N::digits(sprintf('%d/%02d', $this->y - 1, $this->y % 100)));
         } else {
             return WT_I18N::translate('%s&nbsp;CE', WT_I18N::digits($this->y));
         }
     }
 }
Example #2
0
 protected function FormatLongYear()
 {
     return WT_I18N::digits($this->y);
 }
Example #3
0
function format_timestamp($time)
{
    global $DATE_FORMAT, $TIME_FORMAT;
    $time_fmt = $TIME_FORMAT;
    // PHP::date() doesn't do I18N.  Do it ourselves....
    preg_match_all('/%[^%]/', $time_fmt, $matches);
    foreach ($matches[0] as $match) {
        switch ($match) {
            case '%a':
                $t = gmdate('His', $time);
                if ($t == '000000') {
                    $time_fmt = str_replace($match, WT_I18N::translate('midnight'), $time_fmt);
                } elseif ($t < '120000') {
                    $time_fmt = str_replace($match, WT_I18N::translate('a.m.'), $time_fmt);
                } elseif ($t == '120000') {
                    $time_fmt = str_replace($match, WT_I18N::translate('noon'), $time_fmt);
                } else {
                    $time_fmt = str_replace($match, WT_I18N::translate('p.m.'), $time_fmt);
                }
                break;
            case '%A':
                $t = gmdate('His', $time);
                if ($t == '000000') {
                    $time_fmt = str_replace($match, WT_I18N::translate('Midnight'), $time_fmt);
                } elseif ($t < '120000') {
                    $time_fmt = str_replace($match, WT_I18N::translate('A.M.'), $time_fmt);
                } elseif ($t == '120000') {
                    $time_fmt = str_replace($match, WT_I18N::translate('Noon'), $time_fmt);
                } else {
                    $time_fmt = str_replace($match, WT_I18N::translate('P.M.'), $time_fmt);
                }
                break;
            default:
                $time_fmt = str_replace($match, WT_I18N::digits(gmdate(substr($match, -1), $time)), $time_fmt);
        }
    }
    return timestamp_to_gedcom_date($time)->Display(false, $DATE_FORMAT) . '<span class="date"> - ' . $time_fmt . '</span>';
}
Example #4
0
                    echo " onclick=\"statusDisable('zas-grenzen-periode');";
                    echo '"><label for="z_sex">', WT_I18N::translate('gender'), '</label><br>';
                    echo '<input type="radio" id="z_time" name="z-as" value="302"';
                    if ($plotshow == "302") {
                        echo ' checked="checked"';
                    }
                    echo " onclick=\"statusEnable('zas-grenzen-periode');";
                    echo '"><label for="z_time">', WT_I18N::translate('date periods'), '</label><br><br>';
                    echo WT_I18N::translate('Date range'), '<br>';
                    echo '<select id="zas-grenzen-periode" name="zas-grenzen-periode">
				<option value="1700,1750,1800,1850,1900,1950,2000" selected="selected">', WT_I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 50, WT_I18N::digits(1700), WT_I18N::number(50)), '</option>
				<option value="1800,1840,1880,1920,1950,1970,2000">', WT_I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 40, WT_I18N::digits(1800), WT_I18N::number(40)), '</option>
				<option value="1800,1850,1900,1950,2000">', WT_I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 50, WT_I18N::digits(1800), WT_I18N::number(50)), '</option>
				<option value="1900,1920,1940,1960,1980,1990,2000">', WT_I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 20, WT_I18N::digits(1900), WT_I18N::number(20)), '</option>
				<option value="1900,1925,1950,1975,2000">', WT_I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 25, WT_I18N::digits(1900), WT_I18N::number(25)), '</option>
				<option value="1940,1950,1960,1970,1980,1990,2000">', WT_I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 10, WT_I18N::digits(1940), WT_I18N::number(10)), '</option>
			</select>
			<br><br>';
                    echo WT_I18N::translate('results:'), '<br>';
                    echo '<input type="radio" id="y_num" name="y-as" value="201"';
                    if ($plotnp == "201") {
                        echo ' checked="checked"';
                    }
                    echo '><label for="y_num">', WT_I18N::translate('numbers'), '</label><br>';
                    echo '<input type="radio" id="y_perc" name="y-as" value="202"';
                    if ($plotnp == "202") {
                        echo ' checked="checked"';
                    }
                    echo '><label for="y_perc">', WT_I18N::translate('percentage'), '</label><br>';
                    echo '</td>
			</tr>