Changeset 1708


Ignore:
Timestamp:
Oct 7, 2010, 10:26:29 PM (11 years ago)
Author:
roux
Message:

datetime complet pour les interventions pour ordonnancement rss alertes etc

Location:
cpc/trunk/project
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/config/doctrine/schema.yml

    r1674 r1708  
    200200      moretags: [Parlementaire, Personnalite, type]
    201201      devaluate_if_wordcount_under: 200
    202       date: date
     202      date: full_date
    203203  columns:
    204204#    id:
  • cpc/trunk/project/lib/model/doctrine/Intervention.class.php

    r1695 r1708  
    1313  public function getPersonne() {
    1414    return $this->getNomAndFonction();
     15  }
     16
     17  public function getFullDate() {
     18    $datetime = strtotime($this->date);
     19    $moment = $this->Seance->moment;
     20    $heuretime = "10:00";
     21    if (preg_match('/\d:\d/', $moment))
     22      $heuretime = $moment;
     23    else if (preg_match('/^(\d)/', $moment, $match))
     24      $heuretime = sprintf('%02d', 10+4*($match[1]-1)).':00';
     25    $datetime += strtotime($heuretime) - strtotime(today);
     26    $timestamp = $this->timestamp;
     27    $len = strlen($timestamp);
     28    if ($len > 6)
     29      $timestamp = substr($timestamp, $len-6, 6) + 0;
     30    $datetime += $timestamp;
     31    return date('Y-m-d H:i:s', $datetime);
    1532  }
    1633
Note: See TracChangeset for help on using the changeset viewer.