本文整理汇总了PHP中TravelHelper::get_duration_text方法的典型用法代码示例。如果您正苦于以下问题:PHP TravelHelper::get_duration_text方法的具体用法?PHP TravelHelper::get_duration_text怎么用?PHP TravelHelper::get_duration_text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TravelHelper
的用法示例。
在下文中一共展示了TravelHelper::get_duration_text方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: date
?>
</td>
<?php
}
?>
<td class="post-title page-title column-title">
<?php
$check_in = date(TravelHelper::getDateFormat(), strtotime(get_post_meta($post_id, 'check_in', true)));
$check_out = date(TravelHelper::getDateFormat(), strtotime(get_post_meta($post_id, 'check_out', true)));
echo balanceTags($check_in . "<br/>");
$duration = "";
if ($type_tour == 'daily_tour') {
$duration_unit = get_post_meta($item_id, 'duration_unit', true);
$duration = get_post_meta($post_id, 'duration', true);
echo __("Duration", ST_TEXTDOMAIN) . ': ' . $duration . ' ' . TravelHelper::get_duration_text($duration_unit, $duration);
} else {
$diff = TravelHelper::dateDiff(get_post_meta($post_id, 'check_in', true), get_post_meta($post_id, 'check_out', true));
if (!empty($diff) and $diff) {
if ($diff > 1) {
$duration .= esc_attr($diff) . " " . __("days", ST_TEXTDOMAIN);
} else {
$duration .= esc_attr($diff) . " " . __("day", ST_TEXTDOMAIN);
}
}
echo __("Duration", ST_TEXTDOMAIN) . ": " . $duration;
}
?>
</td>
<td class="post-title page-title column-title">
<?php