本文整理汇总了PHP中FrmAppHelper::get_localized_date方法的典型用法代码示例。如果您正苦于以下问题:PHP FrmAppHelper::get_localized_date方法的具体用法?PHP FrmAppHelper::get_localized_date怎么用?PHP FrmAppHelper::get_localized_date使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrmAppHelper
的用法示例。
在下文中一共展示了FrmAppHelper::get_localized_date方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __
<?php
if (!isset($entry)) {
$entry = $record;
}
?>
<div class="misc-pub-section curtime misc-pub-curtime">
<span id="timestamp">
<?php
$date_format = __('M j, Y @ G:i');
printf(__('Published on: <b>%1$s</b>'), FrmAppHelper::get_localized_date($date_format, $entry->created_at));
?>
</span>
</div>
<?php
if ($entry->updated_at && $entry->updated_at != $entry->created_at) {
?>
<div class="misc-pub-section curtime misc-pub-curtime">
<span id="timestamp">
<?php
printf(__('Updated on: <b>%1$s</b>', 'formidable'), FrmAppHelper::get_localized_date($date_format, $entry->updated_at));
?>
</span>
</div>
<?php
}
?>
<?php
do_action('frm_entry_shared_sidebar', $entry);
示例2: calendar_daily_entries
private static function calendar_daily_entries($entry, $display, $args, array &$daily_entries)
{
$i18n = false;
if (is_numeric($display->frm_date_field_id)) {
$date = FrmEntryMeta::get_meta_value($entry, $display->frm_date_field_id);
if ($entry->post_id && !$date && $args['field'] && isset($args['field']->field_options['post_field']) && $args['field']->field_options['post_field']) {
$date = FrmProEntryMetaHelper::get_post_value($entry->post_id, $args['field']->field_options['post_field'], $args['field']->field_options['custom_field'], array('form_id' => $display->frm_form_id, 'type' => $args['field']->type, 'field' => $args['field']));
}
} else {
$date = $display->frm_date_field_id == 'updated_at' ? $entry->updated_at : $entry->created_at;
$i18n = true;
}
if (empty($date)) {
return;
}
if ($i18n) {
$date = FrmAppHelper::get_localized_date('Y-m-d', $date);
} else {
$date = date('Y-m-d', strtotime($date));
}
unset($i18n);
$dates = array($date);
if (!empty($display->frm_edate_field_id)) {
if (is_numeric($display->frm_edate_field_id) && $args['efield']) {
$edate = FrmProEntryMetaHelper::get_post_or_meta_value($entry, $args['efield']);
if ($args['efield'] && $args['efield']->type == 'number' && is_numeric($edate)) {
$edate = date('Y-m-d', strtotime('+' . ($edate - 1) . ' days', strtotime($date)));
}
} else {
if ($display->frm_edate_field_id == 'updated_at') {
$edate = FrmAppHelper::get_localized_date('Y-m-d', $entry->updated_at);
} else {
$edate = FrmAppHelper::get_localized_date('Y-m-d', $entry->created_at);
}
}
if ($edate && !empty($edate)) {
$from_date = strtotime($date);
$to_date = strtotime($edate);
if (!empty($from_date) && $from_date < $to_date) {
for ($current_ts = $from_date; $current_ts <= $to_date; $current_ts += 60 * 60 * 24) {
$dates[] = date('Y-m-d', $current_ts);
}
unset($current_ts);
}
unset($from_date, $to_date);
}
unset($edate);
}
unset($date);
self::get_repeating_dates($entry, $display, $args, $dates);
$dates = apply_filters('frm_show_entry_dates', $dates, $entry);
for ($i = 0; $i < $args['maxday'] + $args['startday']; $i++) {
$day = $i - $args['startday'] + 1;
if (in_array(date('Y-m-d', strtotime($args['year'] . '-' . $args['month'] . '-' . $day)), $dates)) {
$daily_entries[$i][] = $entry;
}
unset($day);
}
}