easyui只显示年月

easyui datebox 扩展 只显示年月 一个日期控件只显示年月是很正常的事情。可是easyui datebox 不支持这种格式的,要么就是截取字符串,不可取,自己没有写过类似的扩展,但是也算是实现功能了,先来张图吧 本人水平有限写不出高深的东西,代码大家都能看懂,但是还是贡献出来,让大家提提意见共同进步吧 阅读详情

一个日期控件只显示年月是很正常的事情。可是easyui datebox 不支持这种格式的,要么就是截取字符串,不可取,自己没有写过类似的扩展,但是也算是实现功能了,先来张图吧

本人水平有限写不出高深的东西,代码大家都能看懂,但是还是贡献出来,让大家提提意见共同进步吧

$.extend($.fn.combobox.methods, {
    yearandmonth: function (jq) {
        return jq.each(function () {
            var obj = $(this).combobox();
            var date = new Date();
            var year = date.getFullYear();
            var month = date.getMonth() + 1;
            var table = $('<table>');
            var tr1 = $('<tr>');
            var tr1td1 = $('<td>', {
                text: '-',
                click: function () {
                    var y = $(this).next().html();
                    y = parseInt(y) - 1;
                    $(this).next().html(y);
                }
            });
            tr1td1.appendTo(tr1);
            var tr1td2 = $('<td>', {
                text: year
            }).appendTo(tr1);

            var tr1td3 = $('<td>', {
                text: '+',
                click: function () {
                    var y = $(this).prev().html();
                    y = parseInt(y) + 1;
                    $(this).prev().html(y);
                }
            }).appendTo(tr1);
            tr1.appendTo(table);

            var n = 1;
            for (var i = 1; i <= 4; i++) {
                var tr = $('<tr>');
                for (var m = 1; m <= 3; m++) {
                    var td = $('<td>', {
                        text: n,
                        click: function () {
                            var yyyy = $(table).find("tr:first>td:eq(1)").html();
                            var cell = $(this).html();
                            var v = yyyy + '-' + (cell.length < 2 ? '0' + cell : cell);
                            obj.combobox('setValue', v).combobox('hidePanel');

                        }
                    });
                    if (n == month) {
                        td.addClass('tdbackground');
                    }
                    td.appendTo(tr);
                    n++;
                }
                tr.appendTo(table);
            }
            table.addClass('mytable cursor');
            table.find('td').hover(function () {
                $(this).addClass('tdbackground');
            }, function () {
                $(this).removeClass('tdbackground');
            });
            table.appendTo(obj.combobox("panel"));

        });
    }
});


调用方法 $('#id').combobox('yearandmonth')




.mytable
{
    padding: 0;
    margin: 10px auto;
    border-collapse: collapse;
    font-family: @宋体;
    empty-cells: show;
}

.mytable caption
{
    font-size: 12px;
    color: #0E2D5F;
    height: 16px;
    line-height: 16px;
    border: 1px dashed red;
    empty-cells: show;
}

.mytable tr th
{
    border: 1px dashed #C1DAD7;
    letter-spacing: 2px;
    text-align: left;
    padding: 6px 6px 6px 12px;
    font-size: 13px;
    height: 16px;
    line-height: 16px;
    empty-cells: show;
}

.mytable tr td
{
    font-size: 12px;
    border: 1px dashed #C1DAD7;
    padding: 6px 6px 6px 12px;
    empty-cells: show;
    border-collapse: collapse;
}
.cursor
{
    cursor: pointer;
}
.tdbackground
{
    background-color: #FFE48D;

}


转:http://blog.youkuaiyun.com/zhaobao110/article/details/47755445

EasyUi日期控件datebox 只显示年月 dateboxFormat('#period_export'); function dateboxFormat(dateId){ $(dateId).datebox({ //显示日趋选择对象后再触发弹出月份层的事件,初始化时没有生成月份层 onShowPanel: function () { //触发clic... 阅读详情

相关推荐

只显示年份月份的时间控件

一般插件不能只选年月,easyui活bootstrap等控件又改起来很麻烦,这个方便快捷,导入就能使用,真是居家旅行必备良药!!!

easyUI中datebox只选择年月【亲测,亲改】

因为一直使用laydate比较多,发现JSP中使用laydate简直有点崩溃,加上项目本身使用的就是datebox,没办法,改吧(。最近公司有个老项目需要做二次开发,web端用的jsp,后端就不说了(跟标题无关)目前网上的版本很多,无效的十之八九吧(也不能说无效,部分有效)

qq_25796879的博客 3031

模拟电子课设-半导体直流稳压电源的设计和测试

1、学习直流稳压电源的设计方法; 2、研究直流稳压电源的设计方案; 3、掌握直流稳压电路的调试及主要指标的测试方法。二、设计要求和技术指标 1、设计要求1)、设计一个能输出5V-12V连续可调的直流稳压电源,或±12V的直流稳压电源; 2)、根据设计要求和技术指标设计好电路,选好元件及参数,要求绘出原理图,并用Protel 99SE/DXP画出印制板图; 3)、在万能板或面包板上制作一台直流稳压电源; 4)、测量直流稳压电源的稳压系数; 5)、测量直流稳压电源的内阻; 6)、拟定测试方案和设计步

GJZGRB的博客 1973

easyui日期选择控件:只显示年月

因为easyui自带的控件默认显示的是年月日,所以想要只要年和月,需要重新初始化。 效果: html代码: &amp;lt;%@ page contentType=&quot;text/html;charset=UTF-8&quot; %&amp;gt; &amp;lt;html&amp;gt; &amp;lt;head&amp;gt; &amp;lt;title&amp;gt;easyui年月选择控件&amp

weixin_40367046的博客 3359

第5.1节 构网控制:电压源特性与电压调节

摘要: 构网型变流器的核心物理本质是作为可控交流电压源,通过戴维南等效模型(受控电势源+低输出阻抗)自主建立并调节电压,增强电网电压刚度。其电压调节通过无功-电压闭环控制实现,内环为自动电压调节器(AVR),外环为无功-电压下垂特性,模拟同步发电机功能。关键技术包括自适应增益、虚拟阻抗补偿及动态限流策略,以应对弱电网稳定性、故障过流等问题。该设计满足《规范》对电压调节范围、动态无功支撑的要求,是高比例新能源电力系统电压稳定的关键解决方案。

技术工作者 1110

openlayers6【十九】vue HeatmapLayer热力图层实现热力图效果详解

文章目录1. 写在前面2. Heatmap 类实现热力图2.1 Heatmap 参数2.2 实现热力图3. 完整代码4. 添加删除map图层的方法5. 热力图自身的get,set方法 1. 写在前面 我们主要看热力图的效果,区域绘制效怎么设置详细内容可以访问 openlayers6【十七】vue VectorLayer矢量图层画地图省市区,多省市区(粤港澳大湾区)效果详解 在 openlayers 中,图层是使用 layer 对象表示的,主要有 WebGLPoints Layer、热度图(HeatMap L

@必意玲 1万+

EasyUI的datebox,只显示年月功能

之前做datebox只显示年月的功能是参照攻城狮老丁的博客 不只是我公司框架的问题还是其他问题 有点小bug,做了改动,顺便做个记录 $('#rePPR_TIME').datebox({ onShowPanel : function() {// 显示日趋选择对象后再触发弹出月份层的事件,初始化时没有生成月份层 span.trigger('click'...

起个破名真费劲..的博客 840

选型不再靠感觉:一文看懂 SAP Event Mesh 与 SAP Integration Suite, advanced event mesh 的能力边界

本文对比分析了SAP Event Mesh与SAP Integration Suite, advanced event mesh的差异。SAP Event Mesh适合轻量级场景,主要用于SAP系统间异步通信,支持AMQP、MQTT等协议,消息大小限制为1MB。而advanced event mesh面向企业级事件网络,提供跨云/本地部署、事件治理、监控等高级功能,支持30MB消息和更大存储容量。选择时需考虑业务规模、实时性要求、治理需求等因素:单一SAP生态内扩展可选Event Mesh;跨区域、多云环境

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 135

修改easyui日期控件只显示年月,并且只能选择年月

更改easyui日期控件,使其只显示到年月  function myFormatter(date){             var y = date.getFullYear();             var m = date.getMonth()+1;             return y+'-'+(m         }

AI开源工具分享 8265

在 ABAP RAP 草稿模式中实现校验与 State Message:从业务规则到 Fiori 体验的全链路实践

本文深入探讨了SAP RAP框架中草稿业务对象的校验与消息机制,重点分析了validation、state message和transition message的应用场景及实现方法。文章指出,RAP校验机制可确保草稿数据的完整性,通过即时反馈防止错误数据进入激活态。同时详细比较了两类消息:state message(持久化)和transition message(临时性)的特点与适用场景。作者结合旅游预订案例,展示了如何在数据模型、行为定义和行为实现中配置校验规则,并给出工程实践中的常见误区与解决方案,如避

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 196

SAP Business Technology Platform 支持的技术栈

SAP Business Technology Platform(简称 BTP)是 SAP 提供的一个综合技术平台,旨在帮助企业实现业务转型和创新。BTP 融合了数据库管理、应用开发、集成、分析和智能技术,为企业提供从基础架构到端到端应用的全面服务。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 1568

easyui的datebox只显示到年月

网上让easyui的datebox日期控显示到年月的方法基本都是这段代码,留着做参考 //只显示年月 function convertDatebox(domId) { $("#" + domId).datebox({ onShowPanel: function () {//显示日趋选择对象后再触发弹出月份层的事件,初始化时没有生成月份层 spa...

秋名山的放牛娃的博客 751

英飞凌Tricore实战系列导读

笔者结合项目应用经验对Tricore MCU的开发及应用经验进一步总结,成人达己,渡己渡人。

initiallizer的博客 3793

EasyUi日期控件datebox设置,只显示年月,也只能选择年月

EasyUi日期控件datebox设置,只显示年月,也只能选择年月 EasyUi 最好是1.5 以上的,1.3左右的有点问题 1、input 代码 <table> <tr> <td>年月</td> <td> <input id="attYearMonth" ...

度 1803

【YOLO26实战全攻略】19——智慧交通(一):高速抛洒物与事故检测全流程落地

在智慧交通领域,高速公路抛洒物、交通事故等突发状况常导致二次事故与大规模拥堵,传统人工监控存在响应滞后、覆盖有限等痛点。本文基于Ultralytics YOLO26算法,结合ByteTrack多目标跟踪技术,构建从数据准备、模型训练到边缘部署的全栈式智慧交通检测系统。核心内容包括:多车型专属数据集构建、抛洒物检测模型优化、ByteTrack轨迹跟踪集成、异常事件(违停/逆行/碰撞)识别逻辑实现,以及NVIDIA Jetson边缘设备部署方案。

专注于人工智能、软件开发、工控自动化、工厂数字化及智能化等领域,希望和大家共同进步! 1495

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

EasyUI Datebox只显示到年月不显示日

在网上找了一些借鉴 改了一些代码 效果如下: 两边的datebox都只显示到年月 不显示日 代码如下: //aspx代码 <input id="txtStartTime" type="text" class="easyui-datebox" style="width: 150px;"> <input id="txtEndTime" type="text" class="...

An Insecure Programming 886

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

EasyUI datebox控件默认只显示年月选择

EasyUI datebox控件默认只显示年月选择 EasyUI 的时间控件datebox一般默认为显示日期选择,有的时候业务需求只显示年份与月份,原生的datebox控件js并没有提供这样的选项,这时候就需要写js去实现,废话不多说,上实例: 1.下载easyui包 首先需要下载easyui包,这个直接从官网上下载就行了:http://www.jeasyui.net/download/jquer...

chenzhang1234的博客 1416

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

easyUI框架下实现日期按年,年月,年月日方式显示

第一次使用easyUI,需求要求按照不同方式显示时间,于是自己尝试通过API和网上别人的一些思路来进行一番改造,想要更改easyui的时间格式,主要是基于API中parser属性和formatter属性,通过解析日期字符串格式和格式化自己需要的日期格式即可完成//此为显示年月的代码$("#time2").click(function(){ $('#date1').datebox({

W2G的专栏 9003

easyui datebox时间控件如何只显示年月

easyui datebox控件,只显示年月,不显示年月日 需要的效果图如下: 具体的js代码: <script> $(function(){ intiMonthBox('costTime'); }); var intiMonthBox = function(id){ var d...

weixin_30262255的博客 99

easyui 修改日期选择框只显示年月,

只显示年月的方法:此方法允许用户输入的话会弹出到日,但是选择的值还是正确的月份值,最好使用editable="false"属性将用户输入禁用直接弹出选择框 $(function () { $('#id').datebox({ //显示日趋选择对象后再触发弹出月份层的事件,初始化时没有生成月份层 onShowPanel: fu...

l1833812的博客 734

jquery easyUI 日期格式化,只显示年或年月

一、问题描述: jquery easyui 本身不支持只显示年 二、解决方案: 1、增加格式化方法及解析方法 formatter:yearFormatter,parser:yearParser 如下面所示 /* 年度日历HTML代码: */ <input id="attYear" class="easyui-datebox" name="attYear" data-options="form...

weixin_33755554的博客 995

easyui combobox日期框只显示年月

&lt;table&gt; &lt;tr&gt; &lt;td&gt;年月&lt;/td&gt; &lt;td&gt; &lt;input id="attYearMonth" editable="false" name="attYearMonth" class="easyui-datebox&quo

博客 1605

easyui datebox 只显示年月

$(function(){ yearAndMonth($("#datebox")); $(".calendar-header").hide(); }) /** * @parm obj 替换的元素 **/ function yearAndMonth(obj){ obj.datebox({ value:[[${date}]], buttons:buttons,

justinytsoft的博客 871

EasyUi日期控件datebox设置,只显示年月

html代码 年月 js代码 $('#attYearMonth').datebox({ //显示日趋选择对象后再触发弹出月份层的事件,初始化时没有生成月份层 onShowPanel: function () { //触发click事件弹出月份层 span.trigger('click');

编程人生的博客 1966
上一篇: 前台encodeURL后台decode无效
下一篇: form表单中的input 清空出现逗号
zy_crazy_code
博客等级 码龄12年 290粉丝 164原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值