Added a formatting method to print the age of a datetime object, and modified the lease view to use it. I anticipate customizing the function to be more fuzzy and less precise.
git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605@89 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -64,4 +64,9 @@ class FormatHelper extends AppHelper {
|
|||||||
return $comment;
|
return $comment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function age($datetime) {
|
||||||
|
return $time->timeAgoInWords($datetime,
|
||||||
|
array('end' => '+99 years'));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,13 +35,11 @@ $rows = array(array('ID', $lease['id']),
|
|||||||
array('Move-in Planned', FormatHelper::date($lease['movein_planned_date'])),
|
array('Move-in Planned', FormatHelper::date($lease['movein_planned_date'])),
|
||||||
array('Move-in', (FormatHelper::date($lease['movein_date'])
|
array('Move-in', (FormatHelper::date($lease['movein_date'])
|
||||||
. ' ('
|
. ' ('
|
||||||
. $time->timeAgoInWords($lease['movein_date'],
|
. FormatHelper::age($lease['movein_date'])
|
||||||
array('end' => '+99 years'))
|
|
||||||
. ')')),
|
. ')')),
|
||||||
array('Move-out', (FormatHelper::date($lease['moveout_date'])
|
array('Move-out', (FormatHelper::date($lease['moveout_date'])
|
||||||
. ' ('
|
. ' ('
|
||||||
. $time->timeAgoInWords($lease['moveout_date'],
|
. FormatHelper::age($lease['moveout_date'])
|
||||||
array('end' => '+99 years'))
|
|
||||||
. ')')),
|
. ')')),
|
||||||
array('Move-out Planned', FormatHelper::date($lease['moveout_planned_date'])),
|
array('Move-out Planned', FormatHelper::date($lease['moveout_planned_date'])),
|
||||||
array('Notice Given', FormatHelper::date($lease['notice_given_date'])),
|
array('Notice Given', FormatHelper::date($lease['notice_given_date'])),
|
||||||
@@ -51,8 +49,8 @@ $rows = array(array('ID', $lease['id']),
|
|||||||
array('controller' => 'accounts',
|
array('controller' => 'accounts',
|
||||||
'action' => 'view',
|
'action' => 'view',
|
||||||
$account['id']))),
|
$account['id']))),
|
||||||
array('Deposit', (FormatHelper::currency($lease['deposit']))),
|
array('Deposit', FormatHelper::currency($lease['deposit'])),
|
||||||
array('Rent', (FormatHelper::currency($lease['amount']))),
|
array('Rent', FormatHelper::currency($lease['amount'])),
|
||||||
array('Comment', $lease['comment']));
|
array('Comment', $lease['comment']));
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user