欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 前端技术 > javascript >内容正文

javascript

帆软日期控件变灰_FineReport-JS脚本常见日期使用整理

发布时间:2025/3/12 javascript 40 豆豆
生活随笔 收集整理的这篇文章主要介绍了 帆软日期控件变灰_FineReport-JS脚本常见日期使用整理 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

var mydate = new Date(); //创建日期对象,返回值为当前日期(包涵时分秒)

mydate.setMonth(mydate.getMonth()-1); //设置日期对象中的“月”,为当前月-1

this.options.form.getWidgetByName("date").setValue(mydate); //赋值给日期控件

var mydate = new Date(); //创建日期对象,返回值为当前日期(包涵时分秒)

this.options.form.getWidgetByName("date").setValue(mydate); //赋值给日期控件

var mydate = new Date(); //创建日期对象,返回值为当前日期(包涵时分秒)

mydate.setDate(mydate.getDate()-1); //设置日期对象中的“日”,为当前日-1

this.options.form.getWidgetByName("date").setValue(mydate); //赋值给日期控件

//lastday

var mydate = new Date(); //创建日期对象,返回值为当前日期(包涵时分秒)

var mydate1 = new Date(); //创建日期对象,返回值为当前日期(包涵时分秒)

mydate.setDate(mydate.getDate()-1); //设置日期对象中的“日”,为当前日-1

this.options.form.getWidgetByName("begindate").setValue(mydate); //赋值给日期控件

this.options.form.getWidgetByName("enddate").setValue(mydate1); //赋值给日期控件

//recent7days

var mydate = new Date(); //创建日期对象,返回值为当前日期(包涵时分秒)

var mydate1 = new Date(); //创建日期对象,返回值为当前日期(包涵时分秒)

mydate.setDate(mydate.getDate()-7); //设置日期对象中的“日”,为当前日-7

mydate1.setDate(mydate1.getDate()-1); //设置日期对象中的“日”,为当前日-1

this.options.form.getWidgetByName("begindate").setValue(mydate); //赋值给日期控件

this.options.form.getWidgetByName("enddate").setValue(mydate1); //赋值给日期控件

//lastweek

var mydate = new Date(); //创建日期对象,返回值为当前日期(包涵时分秒)

var mydate1 = new Date(); //创建日期对象,返回值为当前日期(包涵时分秒)

mydate.setDate(mydate.getDate()-7); //设置日期对象中的“日”,为当前日-7

mydate.setDate(mydate.getDate()-mydate.getDay()+1)//设置日期对象中的“日”,为当前日的周一

mydate1.setDate(mydate.getDate()+6); //设置日期对象中的“日”,为当前日的周天

this.options.form.getWidgetByName("begindate").setValue(mydate); //赋值给日期控件

this.options.form.getWidgetByName("enddate").setValue(mydate1); //赋值给日期控件

//lastmonth

var mydate = new Date(); //创建日期对象,返回值为当前日期(包涵时分秒)

var mydate1 = new Date(); //创建日期对象,返回值为当前日期(包涵时分秒)

mydate.setMonth(mydate.getMonth()-1); //设置日期对象中的“月”,为当前月-1

mydate.setDate(1);//设置日期对象中的“日”,为当前月一号

mydate1.setDate(1);//设置日期对象中的“日”,为当前月一号

mydate1.setDate(mydate1.getDate()-1)//设置日期对象中的“日”,为当前月一号的

总结

以上是生活随笔为你收集整理的帆软日期控件变灰_FineReport-JS脚本常见日期使用整理的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。