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


PHP Calendar::thisDay方法代码示例

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


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

示例1: thisYear

 /**
  * Returns the value for this year
  *
  * When a on the first/last week of the year, the year of the week is
  * calculated according to ISO-8601
  *
  * @param string $format return value format ['int' | 'timestamp' | 'object' | 'array']
  *
  * @return int e.g. 2003 or timestamp
  * @access public
  */
 function thisYear($format = 'int')
 {
     $tmp_cal = new Calendar();
     $tmp_cal->setTimestamp($this->thisWeek);
     $first_dow = $tmp_cal->thisDay('array');
     $days_in_week = $tmp_cal->cE->getDaysInWeek($tmp_cal->year, $tmp_cal->month, $tmp_cal->day);
     $tmp_cal->day += $days_in_week;
     $last_dow = $tmp_cal->thisDay('array');
     if ($first_dow['year'] == $last_dow['year']) {
         return $first_dow['year'];
     }
     if ($last_dow['day'] > floor($days_in_week / 2)) {
         return $last_dow['year'];
     }
     return $first_dow['year'];
 }
开发者ID:par-orillonsoft,项目名称:phpwebsite,代码行数:27,代码来源:Week.php

示例2: thisDay

 /**
  * Returns this day
  * <b>Note:</b> overrides parent method to prevent values
  * being returned for "Empty" days
  * @param boolean set to true to return a timestamp
  * @return int day of month e.g. 11
  * @access public
  */
 function thisDay($asTs = false)
 {
     if ($this->empty) {
         return false;
     } else {
         return Calendar::thisDay($asTs);
     }
 }
开发者ID:nanoprime,项目名称:sureinvoice,代码行数:16,代码来源:Day.php

示例3: GestionAffichageCalendrier


//.........这里部分代码省略.........
        foreach ($tableau_resultat as $fiche) {
            $valeurs_fiche = json_decode($fiche[0], true);
            $valeurs_fiche = array_map('utf8_decode', $valeurs_fiche);
            //echo $valeurs_fiche['bf_titre'].' du '.$valeurs_fiche['bf_date_debut_evenement'].' au '.$valeurs_fiche['bf_date_fin_evenement'].'<br />';
            //echo 'date fin mois : '.date('Y-n-j', $ts_jour_fin_mois).'<br />';
            //echo 'date debut mois : '.date('Y-n-j', $ts_jour_debut_mois).'<br />';
            if (isset($valeurs_fiche['bf_date_debut_evenement'])) {
                $dateArr = explode("-", $valeurs_fiche['bf_date_debut_evenement']);
                $date1Int = mktime(0, 0, 0, $dateArr[1], $dateArr[2], $dateArr[0]);
            } else {
                $date1Int = NULL;
            }
            if (isset($valeurs_fiche['bf_date_fin_evenement'])) {
                $dateArr = explode("-", $valeurs_fiche['bf_date_fin_evenement']);
                $date2Int = mktime(0, 0, 0, $dateArr[1], $dateArr[2], $dateArr[0]);
            } else {
                $date2Int = NULL;
            }
            //echo ($date1Int < $ts_jour_fin_mois).' = ($date1Int < $ts_jour_fin_mois)';
            //echo ($date2Int >= $ts_jour_debut_mois).' = ($date2Int >= $ts_jour_debut_mois)';
            if ($date1Int && $date2Int) {
                $tab_fiches[] = $valeurs_fiche;
            }
        }
        $selection = array();
        $evenements = array();
        $annee = date('Y', $curStamp);
        $mois = date('m', $curStamp);
        $tablo_jours = array();
        foreach ($tab_fiches as $val_fiche) {
            list($annee_debut, $mois_debut, $jour_debut) = explode('-', $val_fiche['bf_date_debut_evenement']);
            list($annee_fin, $mois_fin, $jour_fin) = explode('-', $val_fiche['bf_date_fin_evenement']);
            $Calendrier = new Calendar($annee_debut, $mois_debut, $jour_debut);
            $ts_jour_suivant = $Calendrier->thisDay('timestamp');
            $ts_jour_fin = mktime(0, 0, 0, $mois_fin, $jour_fin, $annee_fin);
            $naviguer = true;
            while ($naviguer && $ts_jour_suivant <= $ts_jour_fin) {
                // Si le jours suivant est inferieur a la date de fin du mois courrant, on continue...
                if ($ts_jour_suivant < $ts_jour_fin_mois) {
                    $cle_j = date('Y-m-d', $ts_jour_suivant);
                    if (!isset($tablo_jours[$cle_j])) {
                        $tablo_jours[$cle_j]['Calendar_Day'] = new Calendar_Day(date('Y', $ts_jour_suivant), date('m', $ts_jour_suivant), date('d', $ts_jour_suivant));
                        $tablo_jours[$cle_j]['Diary_Event'] = new DiaryEvent($tablo_jours[$cle_j]['Calendar_Day']);
                    }
                    $tablo_jours[$cle_j]['Diary_Event']->setEntry($val_fiche['bf_titre']);
                    $ts_jour_suivant = $Calendrier->nextDay('timestamp');
                    //echo "ici$ts_jour_suivant-";
                    $Calendrier->setTimestamp($ts_jour_suivant);
                    //echo "la".$Calendrier->thisDay('timestamp')."-";
                } else {
                    $naviguer = false;
                }
            }
        }
        // Add the decorator to the selection
        foreach ($tablo_jours as $jour) {
            $selection[] = $jour['Diary_Event'];
        }
        // Affichage Calendrier
        $month->build($selection);
        $retour .= '<table>' . "\n" . '<colgroup>' . "\n" . '<col class="cal_lundi"/>' . "\n" . '<col class="cal_mardi"/>' . "\n" . '<col class="cal_mercredi"/>' . "\n" . '<col class="cal_jeudi"/>' . "\n" . '<col class="cal_vendredi"/>' . "\n" . '<col class="cal_samedi"/>' . "\n" . '<col class="cal_dimanche"/>' . "\n" . '</colgroup>' . "\n" . '<thead>' . "\n" . "<tr>" . "\n";
        if ($type == 'calendrier' || $type == 'calendrierjquery') {
            $retour .= "<th> " . BAZ_LUNDI . "</th>\n\t\t\t  <th> " . BAZ_MARDI . "</th>\n\t\t\t  <th> " . BAZ_MERCREDI . "</th>\n\t\t\t  <th> " . BAZ_JEUDI . "</th>\n\t\t\t  <th> " . BAZ_VENDREDI . "</th>\n\t\t\t  <th> " . BAZ_SAMEDI . "</th>\n\t\t\t  <th> " . BAZ_DIMANCHE . "</th>\n\t\t\t </tr>\n\t\t\t " . '</thead>' . "\n" . '<tbody>' . "\n";
        } elseif ($type == 'calendrierjquerymini') {
            $retour .= "<th> " . BAZ_LUNDI_COURT . "</th>\n\t\t\t  <th> " . BAZ_MARDI_COURT . "</th>\n\t\t\t  <th> " . BAZ_MERCREDI_COURT . "</th>\n\t\t\t  <th> " . BAZ_JEUDI_COURT . "</th>\n\t\t\t  <th> " . BAZ_VENDREDI_COURT . "</th>\n\t\t\t  <th> " . BAZ_SAMEDI_COURT . "</th>\n\t\t\t  <th> " . BAZ_DIMANCHE_COURT . "</th>\n\t\t\t </tr>\n\t\t\t " . '</thead>' . "\n" . '<tbody>' . "\n";
        }
开发者ID:BackupTheBerlios,项目名称:wikiplug,代码行数:67,代码来源:bazar.fonct.cal.php


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