当前位置: 首页>>代码示例>>PHP>>正文


PHP Date::julianDay方法代码示例

本文整理汇总了PHP中Fisharebest\Webtrees\Date::julianDay方法的典型用法代码示例。如果您正苦于以下问题:PHP Date::julianDay方法的具体用法?PHP Date::julianDay怎么用?PHP Date::julianDay使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Fisharebest\Webtrees\Date的用法示例。


在下文中一共展示了Date::julianDay方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: isSourced

 /**
  * Check if a fact has a date and is sourced
  * Values:
  * 		- 0, if no date is found for the fact
  * 		- -1, if the date is not precise
  * 		- -2, if the date is precise, but no source is found
  * 		- 1, if the date is precise, and a source is found
  * 		- 2, if the date is precise, a source exists, and is supported by a certificate (requires _ACT usage)
  * 		- 3, if the date is precise, a source exists, and the certificate supporting the fact is within an acceptable range of date
  *
  * @return int Level of sources
  */
 public function isSourced()
 {
     $isSourced = 0;
     $date = $this->fact->getDate();
     if ($date->isOK()) {
         $isSourced = -1;
         if ($date->qual1 == '' && $date->minimumJulianDay() == $date->maximumJulianDay()) {
             $isSourced = -2;
             $citations = $this->fact->getCitations();
             foreach ($citations as $citation) {
                 $isSourced = max($isSourced, 1);
                 if (preg_match('/3 _ACT (.*)/', $citation)) {
                     $isSourced = max($isSourced, 2);
                     preg_match_all("/4 DATE (.*)/", $citation, $datessource, PREG_SET_ORDER);
                     foreach ($datessource as $daterec) {
                         $datesource = new Date($daterec[1]);
                         if (abs($datesource->julianDay() - $date->julianDay()) < self::DATE_PRECISION_MARGIN) {
                             $isSourced = max($isSourced, 3);
                             //If this level increases, do not forget to change the constant MAX_IS_SOURCED_LEVEL
                         }
                     }
                 }
             }
         }
     }
     return $isSourced;
 }
开发者ID:jon48,项目名称:webtrees-lib,代码行数:39,代码来源:Fact.php

示例2: renderContent


//.........这里部分代码省略.........
                echo Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)) . 'AAAA' . Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn));
                ?>
            		</td>
            		<td>
            			<?php 
                echo Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)) . 'AAAA' . Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn));
                ?>
            		</td>
            		<td>
            		<?php 
                if ($birth_dates = $person->getAllBirthDates()) {
                    foreach ($birth_dates as $num => $birth_date) {
                        if ($num) {
                            ?>
<br/><?php 
                        }
                        ?>
    						<?php 
                        echo $birth_date->display(true);
                    }
                } else {
                    $birth_date = new Date('');
                    if ($person->getTree()->getPreference('SHOW_EST_LIST_DATES')) {
                        $birth_date = $person->getEstimatedBirthDate();
                        echo $birth_date->display(true);
                    } else {
                        echo '&nbsp;';
                    }
                    $birth_dates[0] = new Date('');
                }
                ?>
            		</td>
            		<td><?php 
                echo $birth_date->julianDay();
                ?>
</td>
        			<td>
        			<?php 
                foreach ($person->getAllBirthPlaces() as $n => $birth_place) {
                    $tmp = new \Fisharebest\Webtrees\Place($birth_place, $person->getTree());
                    if ($n) {
                        ?>
<br><?php 
                    }
                    ?>
        				<a href="'<?php 
                    echo $tmp->getURL();
                    ?>
" title="<?php 
                    echo strip_tags($tmp->getFullName());
                    ?>
">
        					<?php 
                    echo \Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits($tmp->getShortName());
                    ?>
        				</a>
        			<?php 
                }
                ?>
        			</td>
        			<?php 
                if (ModuleManager::getInstance()->isOperational(Constants::MODULE_MAJ_ISSOURCED_NAME)) {
                    $isBSourced = $dperson->isBirthSourced();
                    ?>
				   	<td><?php 
                    echo FunctionsPrint::formatIsSourcedIcon('E', $isBSourced, 'BIRT', 1, 'medium');
开发者ID:jon48,项目名称:webtrees-lib,代码行数:67,代码来源:SosaListIndiView.php

示例3: getBlock


//.........这里部分代码省略.........
                        $ind = $yahrzeit->getParent();
                        $content .= "<a href=\"" . $ind->getHtmlUrl() . "\" class=\"list_item name2\">" . $ind->getFullName() . "</a>" . $ind->getSexImage();
                        $content .= "<div class=\"indent\">";
                        $content .= $yahrzeit->getDate()->display(true);
                        $content .= ', ' . I18N::translate('%s year anniversary', $yahrzeit->anniv);
                        $content .= "</div>";
                    }
                }
                break;
            case 'table':
            default:
                $table_id = Uuid::uuid4();
                // table requires a unique ID
                $controller->addExternalJavascript(WT_JQUERY_DATATABLES_JS_URL)->addInlineJavascript('
					jQuery("#' . $table_id . '").dataTable({
						dom: \'t\',
						' . I18N::datatablesI18N() . ',
						autoWidth: false,
						paginate: false,
						lengthChange: false,
						filter: false,
						info: true,
						jQueryUI: true,
						sorting: [[5,"asc"]],
						columns: [
							/* 0-name */ { dataSort: 1 },
							/* 1-NAME */ { visible: false },
							/* 2-date */ { dataSort: 3 },
							/* 3-DATE */ { visible: false },
							/* 4-Aniv */ { class: "center"},
							/* 5-yart */ { dataSort: 6 },
							/* 6-YART */ { visible: false }
						]
					});
					jQuery("#' . $table_id . '").css("visibility", "visible");
					jQuery(".loading-image").css("display", "none");
				');
                $content = '';
                $content .= '<div class="loading-image">&nbsp;</div>';
                $content .= '<table id="' . $table_id . '" class="width100" style="visibility:hidden;">';
                $content .= '<thead><tr>';
                $content .= '<th>' . GedcomTag::getLabel('NAME') . '</th>';
                $content .= '<th>' . GedcomTag::getLabel('NAME') . '</th>';
                $content .= '<th>' . GedcomTag::getLabel('DEAT') . '</th>';
                $content .= '<th>DEAT</th>';
                $content .= '<th><i class="icon-reminder" title="' . I18N::translate('Anniversary') . '"></i></th>';
                $content .= '<th>' . GedcomTag::getLabel('_YART') . '</th>';
                $content .= '<th>_YART</th>';
                $content .= '</tr></thead><tbody>';
                foreach ($yahrzeits as $yahrzeit) {
                    if ($yahrzeit->jd >= $startjd && $yahrzeit->jd < $startjd + $days) {
                        $content .= '<tr>';
                        $ind = $yahrzeit->getParent();
                        // Individual name(s)
                        $name = $ind->getFullName();
                        $url = $ind->getHtmlUrl();
                        $content .= '<td>';
                        $content .= '<a href="' . $url . '">' . $name . '</a>';
                        $content .= $ind->getSexImage();
                        $addname = $ind->getAddName();
                        if ($addname) {
                            $content .= '<br><a href="' . $url . '">' . $addname . '</a>';
                        }
                        $content .= '</td>';
                        $content .= '<td>' . $ind->getSortName() . '</td>';
                        // death/yahrzeit event date
                        $content .= '<td>' . $yahrzeit->getDate()->display() . '</td>';
                        $content .= '<td>' . $yahrzeit->getDate()->julianDay() . '</td>';
                        // sortable date
                        // Anniversary
                        $content .= '<td>' . $yahrzeit->anniv . '</td>';
                        // upcomming yahrzeit dates
                        switch ($calendar) {
                            case 'gregorian':
                                $today = new GregorianDate($yahrzeit->jd);
                                break;
                            case 'jewish':
                            default:
                                $today = new JewishDate($yahrzeit->jd);
                                break;
                        }
                        $td = new Date($today->format('%@ %A %O %E'));
                        $content .= '<td>' . $td->display() . '</td>';
                        $content .= '<td>' . $td->julianDay() . '</td>';
                        // sortable date
                        $content .= '</tr>';
                    }
                }
                $content .= '</tbody></table>';
                break;
        }
        if ($template) {
            if ($block) {
                $class .= ' small_inner_block';
            }
            return Theme::theme()->formatBlock($id, $title, $class, $content);
        } else {
            return $content;
        }
    }
开发者ID:pal-saugstad,项目名称:webtrees,代码行数:101,代码来源:YahrzeitModule.php


注:本文中的Fisharebest\Webtrees\Date::julianDay方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。