参考 https://github.com/2amigos/yiiwheels/blob/master/widgets/datetimepicker/WhDateTimePicker.php

public function registerClientScript()
{
/* publish assets dir */
$path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets';
$assetsUrl = $this->getAssetsUrl($path);
 
/* @var $cs CClientScript */
$cs = Yii::app()->getClientScript();
 
$cs->registerCssFile($assetsUrl . '/css/bootstrap-datetimepicker.min.css');
$cs->registerScriptFile($assetsUrl . '/js/bootstrap-datetimepicker.min.js', CClientScript::POS_END);
if (isset($this->pluginOptions['language'])) {
$cs->registerScriptFile(
$assetsUrl . '/js/locales/bootstrap-datetimepicker.' . $this->pluginOptions['language'] . '.js'
, CClientScript::POS_END);
}
/* initialize plugin */
/* initialize plugin */
$selector = null === $this->selector
? '#' . TbArray::getValue('id', $this->htmlOptions, $this->getId()) . '_datetimepicker'
: $this->selector;
 
$this->getApi()->registerPlugin('datetimepicker', $selector, $this->pluginOptions);
 
if($this->events)
{
 
$this->getApi()->registerEvents($selector, $this->events);
}
}

如果本地的文件里没有红色标记的这句代码(CClientScript::POS_END)的话,请记得加上,再使用下面的方式即可

<?php $this->widget(
'yiiwheels.widgets.datetimepicker.WhDateTimePicker',
array(
'name' => 'UserModel[expire_date]',
'value' => $model->expire_date,
'id' => 'expire_date',
'pluginOptions' => array(
'format' => 'yyyy-MM-dd hh:mm:ss',
'language' => 'zh-CN'
),
)
);
?>

  

yiiwheels.widgets.datetimepicker.WhDateTimePicker language的更多相关文章

  1. yii2-datepicker/datetimepicker插件使用

    datepicker: https://github.com/2amigos/yii2-date-picker-widget 通过composer安装: composer require 2amigo ...

  2. Datetimepicker.js用法

    $('.form_date').datetimepicker({//初始化 language: 'zh-CN', //weekStart: 1, //todayBtn: 1, autoclose: 1 ...

  3. angularJs , json,html片段,bootstrap timepicker angular

    css .demotest { width: %; height: auto; overflow: auto; position: relative; margin: auto; margin-top ...

  4. 一款基于bootstrap的datetimepicker

    <!DOCTYPE HTML> <html> <head> <link href="http://netdna.bootstrapcdn.com/t ...

  5. web 前端常用组件【04】Datetimepicker 和 Lodop

    web项目中日期选择器和打印这两个功能是非常常见,将使用过的日期和打印控件,在这里总结归纳,为方便后面使用. 1.Datetimepicker a.官方API:http://www.bootcss.c ...

  6. bootstrap datetimepicker 中只显示年或者只显示月份

    1.只显示datetimepicker  日历中只显示年份 $("#day-access-calendar").datepicker({ startView: 2, maxView ...

  7. bootstrap的日期插件datetimepicker有问题

    bootstrap的日期插件datetimepicker在chrome中会出现掉下来的现象,而且一直没找到原因,下载最新版的插件直接在各个浏览器中都会掉下来, 问题一直解决不了,转而换其他插件 htt ...

  8. bootstrap日期选择器-datetimepicker

    地址:http://www.bootcss.com/p/bootstrap-datetimepicker/ 使用方法,html: <div class="input-append da ...

  9. bootstrap datetimepicker时间日期控件

    github地址:https://github.com/smalot/bootstrap-datetimepicker Both Date and Time picker widget based o ...

随机推荐

  1. 完数c实现

    完数,顾名思义,就是一个数如果恰好等于它的因子之和.例如6=1+2+3.编写找出1000以内的所有完数 #include <stdio.h> #include <stdlib.h&g ...

  2. [jQuery编程挑战]003 克隆一个页面元素及其相关事件

    挑战: a) 绑定一个点击方法到这个div,点击后此元素会淡出消失 b) 同时克隆一个新的div元素到页面,元素内容是前面div文字内容反向书写(即,sgatbg olleh),同样也具有上面的点击事 ...

  3. PHP分页详细讲解

    网上有好多PHP分页的类,但我们要弄明白PHP分页原理才可以学到知识,今天我就带你学制作PHP分页.     1.前言分页显示是一种非常常见的浏览和显示大量数据的方法,属于web编程中最常处理的事件之 ...

  4. UVALive 4394 String painter

    这题搞了很久很久..弄得我都不想放上来了,但是想了想还是写上来吧,万一以后忘了怎么做了,又得搞很久很久了.题目是要求把一个字符串变成另外一个,每次可以选择一段字符串变成同一个字符,问最少用变多少次.本 ...

  5. 【HDOJ】1510 White Rectangles

    这个题目很好,变形的题目也很多.简单DP. /* 1510 */ #include <cstdio> #include <cstring> #include <cstdl ...

  6. php 环境搭建注意事项

    安装php 环境,最后安装集成环境,因为 apache+php 互联不是很容易. 这里主要是两个工具集成工具(wamp ,AppServ),其实这两个集成环境都包括(apache+mysql+php) ...

  7. C# 中dataTable中的数据批量增加至数据表中

    /// <summary> /// 批量添加 /// </summary> /// <param name="dt"></param> ...

  8. 解读sample4

    说明 被测试代码文件 sample4.h.sample4.cc 测试代码文件 sample4_unittest.cc 官网上如是描述sample4: Sample #4 is another basi ...

  9. 关于fork函数

    这篇文章说得非常好.做个记录: 链接:http://coolshell.cn/articles/7965.html

  10. HDU2050(分平面问题)

    分平面问题: 一.n条直线最多分平面问题. n条直线最多可以把平面分成多少个区域? 此类问题主要采用递归的思想.当有n-1条直线时,平面最多被分成了f(n-1)块区域.如果要使第n条直线分的区域最多, ...