javascript
帆软日期控件变灰_FineReport-JS脚本常见日期使用整理
var mydate = new Date(); //創(chuàng)建日期對象,返回值為當(dāng)前日期(包涵時(shí)分秒)
mydate.setMonth(mydate.getMonth()-1); //設(shè)置日期對象中的“月”,為當(dāng)前月-1
this.options.form.getWidgetByName("date").setValue(mydate); //賦值給日期控件
var mydate = new Date(); //創(chuàng)建日期對象,返回值為當(dāng)前日期(包涵時(shí)分秒)
this.options.form.getWidgetByName("date").setValue(mydate); //賦值給日期控件
var mydate = new Date(); //創(chuàng)建日期對象,返回值為當(dāng)前日期(包涵時(shí)分秒)
mydate.setDate(mydate.getDate()-1); //設(shè)置日期對象中的“日”,為當(dāng)前日-1
this.options.form.getWidgetByName("date").setValue(mydate); //賦值給日期控件
//lastday
var mydate = new Date(); //創(chuàng)建日期對象,返回值為當(dāng)前日期(包涵時(shí)分秒)
var mydate1 = new Date(); //創(chuàng)建日期對象,返回值為當(dāng)前日期(包涵時(shí)分秒)
mydate.setDate(mydate.getDate()-1); //設(shè)置日期對象中的“日”,為當(dāng)前日-1
this.options.form.getWidgetByName("begindate").setValue(mydate); //賦值給日期控件
this.options.form.getWidgetByName("enddate").setValue(mydate1); //賦值給日期控件
//recent7days
var mydate = new Date(); //創(chuàng)建日期對象,返回值為當(dāng)前日期(包涵時(shí)分秒)
var mydate1 = new Date(); //創(chuàng)建日期對象,返回值為當(dāng)前日期(包涵時(shí)分秒)
mydate.setDate(mydate.getDate()-7); //設(shè)置日期對象中的“日”,為當(dāng)前日-7
mydate1.setDate(mydate1.getDate()-1); //設(shè)置日期對象中的“日”,為當(dāng)前日-1
this.options.form.getWidgetByName("begindate").setValue(mydate); //賦值給日期控件
this.options.form.getWidgetByName("enddate").setValue(mydate1); //賦值給日期控件
//lastweek
var mydate = new Date(); //創(chuàng)建日期對象,返回值為當(dāng)前日期(包涵時(shí)分秒)
var mydate1 = new Date(); //創(chuàng)建日期對象,返回值為當(dāng)前日期(包涵時(shí)分秒)
mydate.setDate(mydate.getDate()-7); //設(shè)置日期對象中的“日”,為當(dāng)前日-7
mydate.setDate(mydate.getDate()-mydate.getDay()+1)//設(shè)置日期對象中的“日”,為當(dāng)前日的周一
mydate1.setDate(mydate.getDate()+6); //設(shè)置日期對象中的“日”,為當(dāng)前日的周天
this.options.form.getWidgetByName("begindate").setValue(mydate); //賦值給日期控件
this.options.form.getWidgetByName("enddate").setValue(mydate1); //賦值給日期控件
//lastmonth
var mydate = new Date(); //創(chuàng)建日期對象,返回值為當(dāng)前日期(包涵時(shí)分秒)
var mydate1 = new Date(); //創(chuàng)建日期對象,返回值為當(dāng)前日期(包涵時(shí)分秒)
mydate.setMonth(mydate.getMonth()-1); //設(shè)置日期對象中的“月”,為當(dāng)前月-1
mydate.setDate(1);//設(shè)置日期對象中的“日”,為當(dāng)前月一號
mydate1.setDate(1);//設(shè)置日期對象中的“日”,為當(dāng)前月一號
mydate1.setDate(mydate1.getDate()-1)//設(shè)置日期對象中的“日”,為當(dāng)前月一號的
總結(jié)
以上是生活随笔為你收集整理的帆软日期控件变灰_FineReport-JS脚本常见日期使用整理的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 陈顺志 php,芦芽山之情
- 下一篇: xlwt什么版本支持xlsx的版本_Sp