Improving the DateTimePicker Yii Extension

The Yii extension DateTimePicker is a great extension when you want a user to be able to select a date and time within the same popup for an input.  We have recently started to use it extensively for dates & times that occur in future months.  We ran into a problem, however, in that the date would default to today’s date – a real headache for the user.  The root cause of the problem is that the Yii extension’s jQuery files are a few versions behind.  To fix it, you can upgrade the ‘assets’ folder with the new version of Trent Richardson’s jQuery-TimePicker-addon extension.  Here’s a step-by-step:

  1. Download the zipped jQuery-TimePicker-addon from github
  2. Extract the zipped contents into your protected/extensions/timepicker/assets folder
  3. Update the minified jQuery file.  You can either copy the exact same code from the main js file into this file, or you can minify it using one of the many easy-to-use JavaScript minifiers.
  4. Test it out!
Share this page:
  • Facebook
  • Twitter
  • Reddit
  • Google Bookmarks
  • email
  • Print
  • RSS
  • Digg
  • StumbleUpon
  • del.icio.us
  • Slashdot
  • Technorati
  • Tumblr

Steven Michaels

Steven Michaels specializes in PHP web applications utilizing MediaWiki, WordPress, Yii Framework and others. He is an open source contributor and leads development for both of Hollow Developers' internal projects, HollowGame and SpeechEase.

Facebook comments:

Leave a Reply