Re: Date picker for CakePHP 2.0.3
I followed the instructions and it works. The problem is when I try to save it to database (MySQL) where it expects date in '-mm-dd' format while I set it to be displayed in 'dd/mm/yy' format in the form. So, I insert codes to change the format as expected by mySQL in beforeSave function in the model as below: $this-data['Posttest']['submit_date'] = date('Y-m-d',strtotime($this-data['Posttest']['submit_date'])); In add view, it works perfectly. But in edit view, the date is still displayed in '-mm-dd' format. On Saturday, December 27, 2014 at 4:07:09 AM UTC+7, Sandeep Kumar wrote: Thank you Florin Trifu for your answer, it saved a lot of time.. I made some changes to script to include date format to hope that helps someone else script $(function() { $(.datepicker).datepicker( { dateFormat: 'yy-mm-dd', onSelect: function(dateText, inst){ $('#select_date').val(dateText); $(#datepicker).datepicker(destroy); } } ); }); /script On Wednesday, November 30, 2011 4:11:27 AM UTC+4, Florin Trifu wrote: Thank you very much! Indeed it worked. Just to let the other users know in case they will have the same problem: 1. Download jquery (http://docs.jquery.com/Downloading_jQuery) and put the file in $project/app/webroot/js (e.q: *$project/app/webroot/js/jquery.js*) 2. Download jquery-ui (http://jqueryui.com/download); I, for example, downloaded a zip archive called: jquery-ui-1.8.16.custom.zip. From this archive you will have to copy the followings: a. *$archive_root/js/jquery-ui-*.js* in *$project/app/webroot/js* (give it a shorter name e.q: jquery-ui.js) b. *$archive_root/css/smothness/** to *$project/app/webroot/css* (including the images; rename the css file to something shorter) 3. Include both js files in your layout. eq: *//$project/app/views/Layouts/default.ctp-echo $this-Html-script(array('jquery', 'jquery-ui'));*4. Include the css file. Eq *//$project/app/views/Layouts/default.ctp -echo $this-Html-css('jquery-ui.css');*5. Put this lines of code before calling the date-picker: *script$(function() {$(#datepicker).datepicker();});/script* 6. Call the date picker in your form: *echo $this-Form-input('expire', array( 'id'='datepicker','type'='text')* This is it! Best regards! -- 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 cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: Date picker for CakePHP 2.0.3
Hello, Thanks actually it worked.. I solved my problem and stuck in another problem...it renders datepicker but its not rendering theme..:-( On Wednesday, November 30, 2011 at 5:41:27 AM UTC+5:30, Florin Trifu wrote: Thank you very much! Indeed it worked. Just to let the other users know in case they will have the same problem: 1. Download jquery (http://docs.jquery.com/Downloading_jQuery) and put the file in $project/app/webroot/js (e.q: *$project/app/webroot/js/jquery.js*) 2. Download jquery-ui (http://jqueryui.com/download); I, for example, downloaded a zip archive called: jquery-ui-1.8.16.custom.zip. From this archive you will have to copy the followings: a. *$archive_root/js/jquery-ui-*.js* in *$project/app/webroot/js* (give it a shorter name e.q: jquery-ui.js) b. *$archive_root/css/smothness/** to *$project/app/webroot/css* (including the images; rename the css file to something shorter) 3. Include both js files in your layout. eq: *//$project/app/views/Layouts/default.ctp-echo $this-Html-script(array('jquery', 'jquery-ui'));*4. Include the css file. Eq *//$project/app/views/Layouts/default.ctp -echo $this-Html-css('jquery-ui.css');*5. Put this lines of code before calling the date-picker: *script$(function() {$(#datepicker).datepicker();});/script* 6. Call the date picker in your form: *echo $this-Form-input('expire', array( 'id'='datepicker','type'='text')* This is it! Best regards! -- 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 cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: Date picker for CakePHP 2.0.3
Thank you Florin Trifu for your answer, it saved a lot of time.. I made some changes to script to include date format to hope that helps someone else script $(function() { $(.datepicker).datepicker( { dateFormat: 'yy-mm-dd', onSelect: function(dateText, inst){ $('#select_date').val(dateText); $(#datepicker).datepicker(destroy); } } ); }); /script On Wednesday, November 30, 2011 4:11:27 AM UTC+4, Florin Trifu wrote: Thank you very much! Indeed it worked. Just to let the other users know in case they will have the same problem: 1. Download jquery (http://docs.jquery.com/Downloading_jQuery) and put the file in $project/app/webroot/js (e.q: *$project/app/webroot/js/jquery.js*) 2. Download jquery-ui (http://jqueryui.com/download); I, for example, downloaded a zip archive called: jquery-ui-1.8.16.custom.zip. From this archive you will have to copy the followings: a. *$archive_root/js/jquery-ui-*.js* in *$project/app/webroot/js* (give it a shorter name e.q: jquery-ui.js) b. *$archive_root/css/smothness/** to *$project/app/webroot/css* (including the images; rename the css file to something shorter) 3. Include both js files in your layout. eq: *//$project/app/views/Layouts/default.ctp-echo $this-Html-script(array('jquery', 'jquery-ui'));*4. Include the css file. Eq *//$project/app/views/Layouts/default.ctp -echo $this-Html-css('jquery-ui.css');*5. Put this lines of code before calling the date-picker: *script$(function() {$(#datepicker).datepicker();});/script* 6. Call the date picker in your form: *echo $this-Form-input('expire', array( 'id'='datepicker','type'='text')* This is it! Best regards! -- 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 cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: Date picker for CakePHP 2.0.3
Thank you for summary! :) Dne středa, 30. listopadu 2011 1:11:27 UTC+1 Florin Trifu napsal(a): Thank you very much! Indeed it worked. Just to let the other users know in case they will have the same problem: 1. Download jquery (http://docs.jquery.com/Downloading_jQuery) and put the file in $project/app/webroot/js (e.q: *$project/app/webroot/js/jquery.js*) 2. Download jquery-ui (http://jqueryui.com/download); I, for example, downloaded a zip archive called: jquery-ui-1.8.16.custom.zip. From this archive you will have to copy the followings: a. *$archive_root/js/jquery-ui-*.js* in *$project/app/webroot/js* (give it a shorter name e.q: jquery-ui.js) b. *$archive_root/css/smothness/** to *$project/app/webroot/css*(including the images; rename the css file to something shorter) 3. Include both js files in your layout. eq: *//$project/app/views/Layouts/default.ctp-echo $this-Html-script(array('jquery', 'jquery-ui'));*4. Include the css file. Eq *//$project/app/views/Layouts/default.ctp -echo $this-Html-css('jquery-ui.css');*5. Put this lines of code before calling the date-picker: *script$(function() {$(#datepicker).datepicker();});/script* 6. Call the date picker in your form: *echo $this-Form-input('expire', array( 'id'='datepicker','type'='text')* This is it! Best regards! -- 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 cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: Date picker for CakePHP 2.0.3
@Florin Trifu Thanks for the instruction...Works perfectly! @Yen Hua Chuah You can set the date format here: script $(function() { $(#datepicker).datepicker({ dateFormat: yy-mm-dd }); }); /script Check out the API documentation...It is pretty nice. http://api.jqueryui.com/datepicker/#option-dateFormat On Thursday, February 21, 2013 1:25:13 AM UTC-6, Yen Hua Chuah wrote: Hi it does work but the default date format is mm/dd/. How can i change it to /mm/dd please advise thanks chris On Wednesday, January 23, 2013 3:53:30 PM UTC+8, Gian Carlo Asuncion wrote: Works like magic bro no more conflict on other components, keep sharing God Bless! On Tuesday, November 29, 2011 4:11:27 PM UTC-8, Florin Trifu wrote: Thank you very much! Indeed it worked. Just to let the other users know in case they will have the same problem: 1. Download jquery (http://docs.jquery.com/Downloading_jQuery) and put the file in $project/app/webroot/js (e.q: * $project/app/webroot/js/jquery.js*) 2. Download jquery-ui (http://jqueryui.com/download); I, for example, downloaded a zip archive called: jquery-ui-1.8.16.custom.zip. From this archive you will have to copy the followings: a. *$archive_root/js/jquery-ui-*.js* in *$project/app/webroot/js* (give it a shorter name e.q: jquery-ui.js) b. *$archive_root/css/smothness/** to *$project/app/webroot/css*(including the images; rename the css file to something shorter) 3. Include both js files in your layout. eq: * //$project/app/views/Layouts/default.ctp - echo $this-Html-script(array('jquery', 'jquery-ui')); *4. Include the css file. Eq *//$project/app/views/Layouts/default.ctp - echo $this-Html-css('jquery-ui.css'); *5. Put this lines of code before calling the date-picker: *script $(function() { $(#datepicker).datepicker(); }); /script* 6. Call the date picker in your form: *echo $this-Form-input('expire', array( 'id'='datepicker', 'type'='text' )* This is it! Best regards! -- 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 cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Date picker for CakePHP 2.0.3
Good job. You could use even time picker http://labs.perifer.se/timedatepicker/ -- 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 cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Date picker for CakePHP 2.0.3
Hi it does work but the default date format is mm/dd/. How can i change it to /mm/dd please advise thanks chris On Wednesday, January 23, 2013 3:53:30 PM UTC+8, Gian Carlo Asuncion wrote: Works like magic bro no more conflict on other components, keep sharing God Bless! On Tuesday, November 29, 2011 4:11:27 PM UTC-8, Florin Trifu wrote: Thank you very much! Indeed it worked. Just to let the other users know in case they will have the same problem: 1. Download jquery (http://docs.jquery.com/Downloading_jQuery) and put the file in $project/app/webroot/js (e.q: * $project/app/webroot/js/jquery.js*) 2. Download jquery-ui (http://jqueryui.com/download); I, for example, downloaded a zip archive called: jquery-ui-1.8.16.custom.zip. From this archive you will have to copy the followings: a. *$archive_root/js/jquery-ui-*.js* in *$project/app/webroot/js* (give it a shorter name e.q: jquery-ui.js) b. *$archive_root/css/smothness/** to *$project/app/webroot/css*(including the images; rename the css file to something shorter) 3. Include both js files in your layout. eq: * //$project/app/views/Layouts/default.ctp - echo $this-Html-script(array('jquery', 'jquery-ui')); *4. Include the css file. Eq *//$project/app/views/Layouts/default.ctp - echo $this-Html-css('jquery-ui.css'); *5. Put this lines of code before calling the date-picker: *script $(function() { $(#datepicker).datepicker(); }); /script* 6. Call the date picker in your form: *echo $this-Form-input('expire', array( 'id'='datepicker', 'type'='text' )* This is it! Best regards! -- 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 cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Date picker for CakePHP 2.0.3
Works like magic bro no more conflict on other components, keep sharing God Bless! On Tuesday, November 29, 2011 4:11:27 PM UTC-8, Florin Trifu wrote: Thank you very much! Indeed it worked. Just to let the other users know in case they will have the same problem: 1. Download jquery (http://docs.jquery.com/Downloading_jQuery) and put the file in $project/app/webroot/js (e.q: * $project/app/webroot/js/jquery.js*) 2. Download jquery-ui (http://jqueryui.com/download); I, for example, downloaded a zip archive called: jquery-ui-1.8.16.custom.zip. From this archive you will have to copy the followings: a. *$archive_root/js/jquery-ui-*.js* in *$project/app/webroot/js* (give it a shorter name e.q: jquery-ui.js) b. *$archive_root/css/smothness/** to *$project/app/webroot/css*(including the images; rename the css file to something shorter) 3. Include both js files in your layout. eq: * //$project/app/views/Layouts/default.ctp - echo $this-Html-script(array('jquery', 'jquery-ui')); *4. Include the css file. Eq *//$project/app/views/Layouts/default.ctp - echo $this-Html-css('jquery-ui.css'); *5. Put this lines of code before calling the date-picker: *script $(function() { $(#datepicker).datepicker(); }); /script* 6. Call the date picker in your form: *echo $this-Form-input('expire', array( 'id'='datepicker', 'type'='text' )* This is it! Best regards! -- 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 post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: Date picker for CakePHP 2.0.3
HELP! It worked fine with your step-by-step instructions, Florin. However, I'm building a search form where I need 2 different datepickers, but it's not working. I guess the problem is that two DOM elements can't have the same value in their ID attribute (which in this case is datepicker) any workarounds? Thanks in advance El martes, 29 de noviembre de 2011 22:11:27 UTC-2, Florin Trifu escribió: Thank you very much! Indeed it worked. Just to let the other users know in case they will have the same problem: 1. Download jquery (http://docs.jquery.com/Downloading_jQuery) and put the file in $project/app/webroot/js (e.q: * $project/app/webroot/js/jquery.js*) 2. Download jquery-ui (http://jqueryui.com/download); I, for example, downloaded a zip archive called: jquery-ui-1.8.16.custom.zip. From this archive you will have to copy the followings: a. *$archive_root/js/jquery-ui-*.js* in *$project/app/webroot/js* (give it a shorter name e.q: jquery-ui.js) b. *$archive_root/css/smothness/** to *$project/app/webroot/css*(including the images; rename the css file to something shorter) 3. Include both js files in your layout. eq: * //$project/app/views/Layouts/default.ctp - echo $this-Html-script(array('jquery', 'jquery-ui')); *4. Include the css file. Eq *//$project/app/views/Layouts/default.ctp - echo $this-Html-css('jquery-ui.css'); *5. Put this lines of code before calling the date-picker: *script $(function() { $(#datepicker).datepicker(); }); /script* 6. Call the date picker in your form: *echo $this-Form-input('expire', array( 'id'='datepicker', 'type'='text' )* This is it! Best regards! -- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
Re: Date picker for CakePHP 2.0.3
Nevermind! solved it, it's working now. I changed *array('id'='datepicker', 'type'='text')* to *array('class'='datepicker', 'type'='text')* and then changed script $(function() { $(#datepicker).datepicker(); }); /script to *script* *$(function() {* * $(.datepicker).datepicker();* *});* */script* this way, jQuery uses the class, not the ID, to find the fields where datepicker must be applied. Regards! El martes, 29 de noviembre de 2011 22:11:27 UTC-2, Florin Trifu escribió: Thank you very much! Indeed it worked. Just to let the other users know in case they will have the same problem: 1. Download jquery (http://docs.jquery.com/Downloading_jQuery) and put the file in $project/app/webroot/js (e.q: * $project/app/webroot/js/jquery.js*) 2. Download jquery-ui (http://jqueryui.com/download); I, for example, downloaded a zip archive called: jquery-ui-1.8.16.custom.zip. From this archive you will have to copy the followings: a. *$archive_root/js/jquery-ui-*.js* in *$project/app/webroot/js* (give it a shorter name e.q: jquery-ui.js) b. *$archive_root/css/smothness/** to *$project/app/webroot/css*(including the images; rename the css file to something shorter) 3. Include both js files in your layout. eq: * //$project/app/views/Layouts/default.ctp - echo $this-Html-script(array('jquery', 'jquery-ui')); *4. Include the css file. Eq *//$project/app/views/Layouts/default.ctp - echo $this-Html-css('jquery-ui.css'); *5. Put this lines of code before calling the date-picker: *script $(function() { $(#datepicker).datepicker(); }); /script* 6. Call the date picker in your form: *echo $this-Form-input('expire', array( 'id'='datepicker', 'type'='text' )* This is it! Best regards! -- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
Re: Date picker for CakePHP 2.0.3
Use a class, not an ID... Em 13/08/2012 21:04, Paolo pmoscate...@gmail.com escreveu: HELP! It worked fine with your step-by-step instructions, Florin. However, I'm building a search form where I need 2 different datepickers, but it's not working. I guess the problem is that two DOM elements can't have the same value in their ID attribute (which in this case is datepicker) any workarounds? Thanks in advance El martes, 29 de noviembre de 2011 22:11:27 UTC-2, Florin Trifu escribió: Thank you very much! Indeed it worked. Just to let the other users know in case they will have the same problem: 1. Download jquery (http://docs.jquery.com/**Downloading_jQueryhttp://docs.jquery.com/Downloading_jQuery) and put the file in $project/app/webroot/js (e.q: * $project/app/webroot/js/jquery.js*) 2. Download jquery-ui (http://jqueryui.com/download)**; I, for example, downloaded a zip archive called: jquery-ui-1.8.16.custom.zip. From this archive you will have to copy the followings: a. *$archive_root/js/jquery-ui-*.js* in *$project/app/webroot/js* (give it a shorter name e.q: jquery-ui.js) b. *$archive_root/css/smothness/** to *$project/app/webroot/css*(including the images; rename the css file to something shorter) 3. Include both js files in your layout. eq: * //$project/app/views/Layouts/default.ctp - echo $this-Html-script(array('jquery', 'jquery-ui')); *4. Include the css file. Eq *//$project/app/views/Layouts/default.ctp - echo $this-Html-css('jquery-ui.css'); *5. Put this lines of code before calling the date-picker: *script $(function() { $(#datepicker).datepicker(); }); /script* 6. Call the date picker in your form: *echo $this-Form-input('expire', array( 'id'='datepicker', 'type'='text' )* This is it! Best regards! -- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en-US. -- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
Re: Date picker for CakePHP 2.0.3
Hey this worked perfectly for me, thanks a lot!! Am Dienstag, 29. November 2011 11:03:06 UTC+1 schrieb Florin Trifu: Hi I need to implement a date picker into my application. I have found this tutorial: http://bakery.cakephp.org/articles/agusti/2010/02/02/transparent-datepicker-with-jquery but unfortunately is not working with my version. Did someone succeeded to implement it or can someone guide me to another resource? Thank you! Best regards! -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Date picker for CakePHP 2.0.3
i cant find where to download http://docs.jquery.com/Downloading_jQuery On Tuesday, November 29, 2011 4:11:27 PM UTC-8, Florin Trifu wrote: Thank you very much! Indeed it worked. Just to let the other users know in case they will have the same problem: 1. Download jquery (http://docs.jquery.com/Downloading_jQuery) and put the file in $project/app/webroot/js (e.q: * $project/app/webroot/js/jquery.js*) 2. Download jquery-ui (http://jqueryui.com/download); I, for example, downloaded a zip archive called: jquery-ui-1.8.16.custom.zip. From this archive you will have to copy the followings: a. *$archive_root/js/jquery-ui-*.js* in *$project/app/webroot/js* (give it a shorter name e.q: jquery-ui.js) b. *$archive_root/css/smothness/** to *$project/app/webroot/css*(including the images; rename the css file to something shorter) 3. Include both js files in your layout. eq: * //$project/app/views/Layouts/default.ctp - echo $this-Html-script(array('jquery', 'jquery-ui')); *4. Include the css file. Eq *//$project/app/views/Layouts/default.ctp - echo $this-Html-css('jquery-ui.css'); *5. Put this lines of code before calling the date-picker: *script $(function() { $(#datepicker).datepicker(); }); /script* 6. Call the date picker in your form: *echo $this-Form-input('expire', array( 'id'='datepicker', 'type'='text' )* This is it! Best regards! -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Date picker for CakePHP 2.0.3
Just want to say: Many thanks guys!!! Le mardi 29 novembre 2011 11:03:06 UTC+1, Florin Trifu a écrit : Hi I need to implement a date picker into my application. I have found this tutorial: http://bakery.cakephp.org/articles/agusti/2010/02/02/transparent-datepicker-with-jquery but unfortunately is not working with my version. Did someone succeeded to implement it or can someone guide me to another resource? Thank you! Best regards! -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Date picker for CakePHP 2.0.3
Hi Florin, You can use http://jqueryui.com/demos/datepicker/. It is really easy to implement no matter if you are using 1.x or 2.x Just use the dateFormat option and configure it to match your database/validation rules. $( .selector ).datepicker( option, dateFormat, 'yy-mm-dd' ); Best, Jordan -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Date picker for CakePHP 2.0.3
I have tried this but it doesn't work for me. I have downloaded the jquery-ui, put the js inside /app/webroot/js, included inside my layout, and then create an input like this: $this-Form-input('expire', array('id'='datepicker')) Nothing happens when I click inside the text box... -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Date picker for CakePHP 2.0.3
You also need the jquery library, and will probably need to actually write some javascript. It's easy: script $(function() { $(#datepicker).datepicker(); }); /script If you have done this, and are still getting errors, check your javascript console to see what is going on. On Nov 29, 9:35 am, Florin Trifu florin.catalin.tr...@gmail.com wrote: I have tried this but it doesn't work for me. I have downloaded the jquery-ui, put the js inside /app/webroot/js, included inside my layout, and then create an input like this: $this-Form-input('expire', array('id'='datepicker')) Nothing happens when I click inside the text box... -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Date picker for CakePHP 2.0.3
I forgot to tell you but jquery is also included. In the javascript console there is no error because the date-picker is not triggered. Can you please tell me where should I put the script you told wrote me? This one: script $(function() { $(#datepicker).datepicker(); }); /script Thank you! -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Date picker for CakePHP 2.0.3
You can put the script anywhere on the page. Anyway, better practice is to put it before the closing head tag of your layout view. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Date picker for CakePHP 2.0.3
Thank you very much! Indeed it worked. Just to let the other users know in case they will have the same problem: 1. Download jquery (http://docs.jquery.com/Downloading_jQuery) and put the file in $project/app/webroot/js (e.q: *$project/app/webroot/js/jquery.js*) 2. Download jquery-ui (http://jqueryui.com/download); I, for example, downloaded a zip archive called: jquery-ui-1.8.16.custom.zip. From this archive you will have to copy the followings: a. *$archive_root/js/jquery-ui-*.js* in *$project/app/webroot/js* (give it a shorter name e.q: jquery-ui.js) b. *$archive_root/css/smothness/** to *$project/app/webroot/css* (including the images; rename the css file to something shorter) 3. Include both js files in your layout. eq: * //$project/app/views/Layouts/default.ctp - echo $this-Html-script(array('jquery', 'jquery-ui')); *4. Include the css file. Eq *//$project/app/views/Layouts/default.ctp - echo $this-Html-css('jquery-ui.css'); *5. Put this lines of code before calling the date-picker: *script $(function() { $(#datepicker).datepicker(); }); /script* 6. Call the date picker in your form: *echo $this-Form-input('expire', array( 'id'='datepicker', 'type'='text' )* This is it! Best regards! -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php