Index: branches/liquidthreads/extensions/LqtModel.php |
— | — | @@ -26,9 +26,7 @@ |
27 | 27 | return $this->moved('+1 month'); |
28 | 28 | } |
29 | 29 | function moved($str) { |
30 | | - $d = new DateTime($this->text()); |
31 | | - $d->modify($str); |
32 | | - return new Date($d->format('YmdHis')); |
| 30 | + return new Date( date('YmdHis', strtotime($this->text() . ' ' . $str)) ); |
33 | 31 | } |
34 | 32 | /* function monthString() { |
35 | 33 | return sprintf( '%04d%02d', $this->year, $this->month ); |
— | — | @@ -43,10 +41,10 @@ |
44 | 42 | $els = array('year', 'month', 'day', 'hour', 'minute', 'second'); |
45 | 43 | $deltas = array(); |
46 | 44 | foreach ($els as $e) {$deltas[$e] = $t->$e - $o->$e; |
47 | | - $t->$e += $t->$e - $o->$e; |
| 45 | + $t->$e += $t->$e - $o->$e; |
48 | 46 | } |
49 | 47 | |
50 | | - // format in style of DateTime::modify(). |
| 48 | + // format in style of date(). |
51 | 49 | $result = ""; |
52 | 50 | foreach( $deltas as $name => $val ) { |
53 | 51 | $result .= "$val $name "; |