Trying to get the date to display correctly and do what I would like is really perplexing for me or I am just making it more complicated then it actually is.
I got some more issues with the date and the issues are tied in a vicious annoying cycle. I will try to explain it the best I can. And I apologize before hand if the post is long because I will include the results from: echo '<pre>'; print_r($form_state); echo '</pre>';
When I use my current date: job_posting_dob
It displays the date on the forum of 1 1 1900. I would like to place day month year in the boxes or blanks. I tried to place the code '#date_label_position' => 'within', but that does nothing. Is there away to put labels or a blank for day month year when using '#type' => 'date', ?
Here is where the vicious annoying cycle starts.
If I change my current date from '#type' => 'date', to '#type' => 'date_select',
I get the labels of year month day in the boxes when I use '#date_label_position' => 'within', However, on the echo page or the results sent to the email I get 2-2-2, which I think it is only displaying the first digit. When I use this:
Code: Select all
$dob = $form_state['values']['job_posting_dob'];
.$dob['year'] . '-' . $dob['month'] . '-' . $dob['day'];[code]
I have made a new date array called job_posting_arrival:
Code: Select all
$form['job_posting_arrival']= array(
'#type' => 'date_popup',
'#title' => t('Arrival Date'),
'#date_label_position' => 'within',
'#date_format' => 'y-m-d',
'#description' => t('Select your approximate arrival date.'),
);
When I use
Code: Select all
echo $arrival['year'] . '-' . $arrival['month'] . '-' . $arrival['day']
it also displays it as 2-2-2.
However, when I use
Code: Select all
echo .$form_state['values']['job_posting_arrival'];
it displays it correctly '2010-11-10 00:00:00'
Is there a way to remove the time or is that how it gets displayed either by using date_popup or date_select or am I stuck with the time to display?
Results:
Array
(
[storage] =>
[submitted] => 1
[values] => Array
(
[job_posting_reference] => JOB26
[job_posting_title] => Job Test
[job_posting_email] =>
[job_posting_coverletter] => efdgf
[job_posting_name] => fdgfd
[job_posting_tele] => 456546
[job_posting_dob] => 2008-02-28 00:00:00
[job_posting_arrival] => 2010-11-10 00:00:00
[job_posting_sex] => Male
[job_posting_nation] => Aus
[job_posting_resume] =>
[job_posting_picture] =>
[op] => Send
[job_posting_submit] => Send
[form_build_id] => form-efd698ba825d83c1b2b5beca146335b2
[form_token] => 97fb0fd0c5151efdabb8703fabc65cf9
[form_id] => job_posting_application_form
)
[clicked_button] => Array
(
[#type] => submit
[#value] => Send
[#post] => Array
(
[job_posting_coverletter] => efdgf
[job_posting_name] => fdgfd
[job_posting_tele] => 456546
[job_posting_dob] => Array
(
[year] => 2008
[hour] => 0
[minute] => 0
[second] => 0
[month] => 2
[day] => 28
)
[job_posting_arrival] => Array
(
[date] => 10-11-10
)
[job_posting_sex] => Male
[job_posting_nation] => Aus
[op] => Send
[form_build_id] => form-79194aada2ba0383e798021ad23223d1
[form_token] => 97fb0fd0c5151efdabb8703fabc65cf9
[form_id] => job_posting_application_form
)
[#programmed] =>
[#tree] =>
[#parents] => Array
(
[0] => job_posting_submit
)
[#array_parents] => Array
(
[0] => job_posting_submit
)
[#weight] => 0.013
[#processed] =>
[#description] =>
[#attributes] => Array
(
)
[#required] =>
[#input] => 1
[#name] => op
[#button_type] => submit
[#executes_submit_callback] => 1
[#process] => Array
(
[0] => form_expand_ahah
)
[#id] => edit-job-posting-submit
)
[process_input] => 1
[redirect] =>
)
Message body empty