jpser
Posts: 44
|
Posted: 08/20/2007, 4:33 AM |
|
php5:
$record->dini->setvalue(ccdateadd("2007-07-01",-1 year));
always returns error
but it gives : Parse error: syntax error, unexpected T_STRING
I tried with adding ccformatdate,ccparsdate
...setvalue(ccformatdate(ccdateadd("2007-07-01",-1 year),"shordate"))
the purpous is to return a date - 1 year
in php5
thanks for answer
_________________
jp serei
|
|
|
Wkempees
|
Posted: 08/20/2007, 6:58 AM |
|
$Component->SetValue(CCDateAdd($Container->date_added->GetValue(),'-1
year') );
CCDateAdd($date, value)
$date, needs to be a valid date as an array.
value is a string as in : '1 year'.
In the above code snippet (BeforeShow event of Textbox StartDate)
I assign to the current component ( $Component->SetValue() )
the value of another textbox on the same form date_added
( $Container->date_added->GetValue() )
additionaly I subtract one year from date_added.
CCDateAdd( $Container->date_added->GetValue(), '-1 year')
|
|
|
|