示例#1
0
<?php

// 3. Выводим содержимое массива $week
// в виде календаря
// Выводим таблицу
echo '
    <div class="schedulerFilterBar">
      ' . link_to(__('Previous Month'), $sf_context->getModuleName() . '/' . $sf_context->getActionName() . '?month=prev_month') . '
      &nbsp;&nbsp;<b>' . app::i18n_date('F Y', $sf_user->getAttribute($scheduler_time)) . '</b>&nbsp;&nbsp;
      ' . link_to(__('Next Month'), $sf_context->getModuleName() . '/' . $sf_context->getActionName() . '?month=next_month') . '
      &nbsp;&nbsp;' . (date('Y-m', $sf_user->getAttribute($scheduler_time)) != date('Y-m') ? link_to(__('Back to ') . app::i18n_date('j F Y'), $sf_context->getModuleName() . '/' . $sf_context->getActionName() . '?month=current_month') : '') . '
      &nbsp;&nbsp;' . __('Today') . ': ' . app::i18n_date('j F Y') . '
    </div>
  ';
echo '
  <table class="schedulerTable">
    <tr>
      <th>' . __('Monday') . '</th>
      <th>' . __('Tuesday') . '</th>
      <th>' . __('Wednesday') . '</th>
      <th>' . __('Thursday') . '</th>
      <th>' . __('Friday') . '</th>
      <th>' . __('Saturday') . '</th>
      <th>' . __('Sunday') . '</th>
    </tr>  
  ';
for ($i = 0; $i < count($week); $i++) {
    echo "<tr>";
    for ($j = 0; $j < 7; $j++) {
        if (!empty($week[$i][$j])) {
            // Если имеем дело с субботой и воскресенья
示例#2
0
文件: app.class.php 项目: noikiy/qdpm
 public static function dateTimeFormat($date, $timestamp = 0, $is_listing = false)
 {
     if ($timestamp > 0) {
         return ($is_listing ? '<span class="hiddenItem">' . $timestamp . '</span>' : '') . str_replace(array('00:00', '00:00:00'), '', app::i18n_date(app::getDateTimeFormat(), $timestamp));
     } elseif (strlen($date) > 0) {
         $v = date_parse($date);
         $timestamp = mktime($v['hour'], $v['minute'], $v['second'], $v['month'], $v['day'], $v['year']);
         return ($is_listing ? '<span class="hiddenItem">' . $timestamp . '</span>' : '') . str_replace(array('00:00', '00:00:00'), '', app::i18n_date(app::getDateTimeFormat(), $timestamp));
     } else {
         return '';
     }
 }