When a user searches post by date, I need to pass the date as a search parameter through the url.
Like : http://siteurl/post/index/created:03/15/2012
As you can see the date format is mm/dd/yy which is creating an issue, as a result I’m getting only 03 as a value in the request.
Edited : Some code from my params i get in controller.
Array
(
[controller] => posts
[action] => index
[named] => Array
(
[created] => 03
)
[pass] => Array
(
[0] => 15
[1] => 2012
)
[plugin] =>
[form] => Array
(
)
[url] => Array
(
[url] => /posts/index/created:03/15/2012
)
[isAjax] =>
)
Is there a way that a user can select date in mm/dd/yy format and then I can change to another format after submitting the form?
You can convert the date into time stamp and pass using:
pass this to the url.
Convert back to ‘mm/dd/yy’ using: