php - CakePHP :: Adding a default date into a DOB field with the form helper? -
This can be a very simple answer, but so far all of my research is not coming up with a reply!
I am using CakePHP 2.4. I have set up a form using KPHHP assistant, with a dub field within the list
$ DOBOps = array ('label' = & gt; 'DOB', 'div' = & Gt; False, 'Type' = & gt; 'Date', 'Date Format' = & gt; DMY, 'Maxier' = & gt; Date ('Y') - 100, 'Miner' => ; Date ('Y'), 'Default' => UserDOB;); $ This- & gt; Form- & gt; Input ('dobra', $ DOBOps); Now it is called dobrud, so it is not listed as a dub in my $ this-> data because I want to convert it to 1 . So I take days, months and years, and I use PHP to convert it to a simple timestamp, which I call $ this-> Request-> Data was set as DOB by using . All this works, my code fixes it and saves the data in the database, but when I go back to the User Profile / Settings page, I will update it with data in the data I want to update.
I have tried, by adding a default tag to it, but it does not work, I have changed back to DD-MM-type format, so $ UserDOB Data timestamp is not there. Thank you,
I solved it, I thought it was because Was loading dd-mm-yyyy I have to set up the data that I'm giving it in the same format - but I feel that when I get it a pure timestamp, I work.
If there is a better way of doing this then please let me know
Thank you.
Comments
Post a Comment