Yii Framework Forum: Yii-Booster Timepicker 24 Hour Issue - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Yii-Booster Timepicker 24 Hour Issue Cannot change 12 hour with 24 hour in Yii-Booster TimePicker Rate Topic: -----

#1 User is offline   superusercloth 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 28-February 13

Posted 07 March 2013 - 07:59 PM

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.
0

#2 User is online   mirunho 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 137
  • Joined: 19-December 12
  • Location:Gdansk, Poland

Posted 08 March 2013 - 03:08 AM

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.
0

#3 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 2,601
  • Joined: 10-October 10
  • Location:Denmark

Posted 08 March 2013 - 04:10 AM

/* moved from General Discussion */
"Less noise - more signal"
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users