Skip to content

Instantly share code, notes, and snippets.

@veganista
Forked from anonymous/gist:4065071
Created November 13, 2012 11:02
Show Gist options
  • Save veganista/4065222 to your computer and use it in GitHub Desktop.
Save veganista/4065222 to your computer and use it in GitHub Desktop.
/*
* If this doenst work then try the below
*/
echo $this->Form->input('Applicant.date_of_birth', array(
'type' => 'date',
'dateFormat' => 'DMY',
'minYear' => date('Y') - 110,
'maxYear' => date('Y')- 18,
)
);
/* This is least prefferred */
echo $this->Form->input('Applicant.date_of_birth', array(
'type' => 'date',
'dateFormat' => 'DMY',
'minYear' => date('Y') - 110,
'maxYear' => date('Y')- 18,
'selected' => $applicationData['Applicant']['date_of_birth'],
)
);
/* this is even worse, but may work*/
echo $this->Form->input('Applicant.date_of_birth', array(
'type' => 'date',
'dateFormat' => 'DMY',
'minYear' => date('Y') - 110,
'maxYear' => date('Y')- 18,
'selected' => strtotime($applicationData['Applicant']['date_of_birth']),
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment