Yii-Booster Timepicker 24 Hour Issue

Hi. I downloaded Yii-Booster extension. I have installed it and I think it’s a good extension.

I try to use its built-in timepicker widget. It works fine. I can display time picker with hour, minute, and am/pm options.

But, when I want to change the default-12-hour to 24 hour display, I can’t do that. I have edited the options in /path/to/my/extension/bootstrap/widgets/TbTimePicker.php like this one:


<?php

/**

 * TbTimePicker class file.

 * @since 1.0.3

 * @see jdewit dot github dot com/bootstrap-timepicker/

 */


/**

 * TbTimePicker widget.

 */

class TbTimePicker extends CInputWidget

{

	public $form;


	/**

	 * @var array the options for the Bootstrap JavaScript plugin.

	 * Available options:

	 * template	string

	 *      'dropdown' (default), Show picker in a dropdown

	 *      'modal', Show picker in a modal

	 *      false, Don't show a widget

	 * minuteStep	integer	15	Specify a step for the minute field.

	 * showSeconds	boolean	false	Show the seconds field.

	 * secondStep	integer	15	Specify a step for the second field.

	 * defaultTime	string

	 *      'current' (default) Set to the current time.

	 *      'value' Set to inputs current value

	 *      false	Do not set a default time

	 * showMeridian	boolean

	 *      true (default)  12hr mode

	 *      false24hr mode

	 * showInputs	boolean

	 *      true (default )Shows the text inputs in the widget.

	 *      false Hide the text inputs in the widget

	 * disableFocus	boolean	false	Disables the input from focusing. This is useful for touch screen devices that

	 *          display a keyboard on input focus.

	 * modalBackdrop	boolean	false	Show modal backdrop.

	 */

	public $options = array(

		'showMeridian'=>false; // I have added this options in order to use 24-hour display

	);


	// to the end of script



But it’s just not work. I have tried other options several times, but it’s failed. Is it a bug in yiibooster extension? Or I just miss something?

Thanks for replying.

You shouldnt change a class file of any widget in bootstrap.

You can achive this behaviour by putting an options in display widget:




<?php $this->widget('bootstrap.widgets.TbTimePicker', array('name'=>'lala', 'options'=>array('showMeridian'=>false))); ?>

Something like that should solve your problem.

And also you should post every question about extensions in extension forum.

[color="#006400"]/* moved from General Discussion */[/color]