参考 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. python自学笔记

    python自学笔记 python自学笔记 1.输出 2.输入 3.零碎 4.数据结构 4.1 list 类比于java中的数组 4.2 tuple 元祖 5.条件判断和循环 5.1 条件判断 5.2 ...

  2. 从零开始学java(小游戏 石头剪刀布)

    Game.java package com.java;import java.util.Scanner;public class Game {        private Player player ...

  3. 【USACO 2.1.2】法雷序列

    [问题描述]     对任意给定的一个自然数 n(n<=160), 将分母小于等于 n 的不可约的真分数按上升的次序排序 , 并且在第一个分数前加上 0/1, 而在最后一个分数后加上 1/1, ...

  4. 对于HttpContext.Current的一点理解

    string[] userInfomationSplits = HttpContext.Current.User.Identity.Name.Split(new string[] { "\\ ...

  5. 解析一下rtmp协议比较难懂的地方

    官方文档写的过于复杂,这里弄个简单的好入门的.chunk 分基础头,消息头,时间戳,数据部分基础头中第一个字节最高位的两个位是用来设置消息头的四种格式的,和基础头没关系,整个基础头有3个字段的长度存储 ...

  6. jQuery中的模拟操作

    jQuery中的模拟操作主要是通过trigger来触发,相当于页面加载完成后不需要用户点击按钮,就可以自动触发页面中的相关事件. trigger(type,[data])可以用来模拟触发自定义事件的触 ...

  7. Js字符串判断

    判断字符串 str=''; if(!str) // str为null 或者"" 或者0

  8. Sample rate 理解

    在Gnuradio中,我们可以看到很多模块中都有Sample rate 这个概念 然后看到一个说明 Any processing block's 'Sample Rate' parameter is ...

  9. DOM&BOM笔记

    day01正课:1. DOM概述2. ***DOM树3. *查找 1. DOM概述: DHTML:动态网页技术的统称 DHTML=HTML+CSS+JS 鄙视题: HTML XHTML DHTML X ...

  10. Spark笔记-treeReduce、reduce、reduceByKey

    参考资料: http://stackoverflow.com/questions/32281417/understadning-treereduce-in-spark http://stackover ...