hi Jeremy Burns,... thank you for your reply,...
Actually,... yes I thought about it, to create additional field "dob" in
users table, bud then again how do I add ONLY Month and Day into it,... You
See,... when user signup to a site,... I use this format
<?php echo $this->Form->input('birthday', array('label' => 'Birthday',
'dateFormat' => 'DMY', 'minYear' => date('Y') - 80, 'maxYear' => date('Y')
- 5 )) ?>
to create "birthday" filed which need to calculate his/her age e.g.
function age($birthday)
{
list($year,$month,$day) = explode("-",$birthday);
$year_diff = date('Y') - $year;
$month_diff = date('m') - $month;
$day_diff = date('d') - $day;
if ($day_diff < 0 || $month_diff < 0)
$year_diff--;
return $year_diff;
}
now the problem is how do add additional into "dob" field ONLY Month and
Day on initial signup,... ??
On Saturday, June 22, 2013 1:35:59 PM UTC-7, Jeremy Burns wrote:
>
> Have you thought about adding month and day fields to the table and
> populating them beforeSave? Less processing required when you want to run
> your cron job.
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com
>
> On 22 Jun 2013, at 21:13:01, Chris <[email protected] <javascript:>>
> wrote:
>
> Hi guys,... can anyone help me please
> Ho w can I illuminate (remove) Year in "birthday" field from users table?
> The concept is to find ONLY Month and Day (e.g. 06-21) from 1964-06-21
> I'm doing this cronjob feature to send email to friends of a user once the
> Birthday is reached... e.g. $this->Email->subject =
> ucfirst(i18n::translate('your friend')) . ' : ' .
> $user['User']['firstname'] . ' ' . ucfirst(i18n::translate('celebrating
> birthday')); on a Social Network site.
>
> thanks in advance
> chris
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected] <javascript:>.
> To post to this group, send email to [email protected]<javascript:>
> .
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>
>
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.