计算时间问题

*若价格不公道,可以让提问者在平台追加赏金哦,平台是您利益的保证

已完成
计算时间问题-窦心房
窦心房 4年前发布
悬赏:30.0 元

问题详情:分类: JavaScript-移动端

switch (rs[0].value) {   //不能使用kendoui来计算时间
//今天
case "DAY":
begin.text(kendo.toString(kendo.date.today(), grc_format));
end.text(kendo.toString(kendo.date.today(), grc_format));
begin.attr("data-val", kendo.toString(kendo.date.today(), grc_format));
end.attr("data-val", kendo.toString(kendo.date.today(), grc_format));
break;
//昨天
case "DAY1":
begin.text(date.previousDay(date.today()).toString(grc_format));
end.text(date.previousDay(date.today()).toString(grc_format));
begin.attr("data-val", date.previousDay(date.today()).toString(grc_format));
end.attr("data-val", date.previousDay(date.today()).toString(grc_format));
break;
//本週
case "WEEK":
begin.text(kendo.toString(dateRangeUtil.getCurrentWeek()[0], grc_format))
end.text(kendo.toString(dateRangeUtil.getCurrentWeek()[1], grc_format));
begin.attr("data-val", kendo.toString(dateRangeUtil.getCurrentWeek()[0], grc_format));
end.attr("data-val", kendo.toString(dateRangeUtil.getCurrentWeek()[1], grc_format));
break;
//上週
case "WEEK1":
begin.text(kendo.toString(dateRangeUtil.getPreviousWeek()[0], grc_format));
end.text(kendo.toString(dateRangeUtil.getPreviousWeek()[1], grc_format));
begin.attr("data-val", kendo.toString(dateRangeUtil.getPreviousWeek()[0], grc_format));
end.attr("data-val", kendo.toString(dateRangeUtil.getPreviousWeek()[1], grc_format));
break;
//本月
case "MONTH":
begin.text(kendo.toString(dateRangeUtil.getCurrentMonth()[0], grc_format))
end.text(kendo.toString(dateRangeUtil.getCurrentMonth()[1], grc_format));
begin.attr("data-val", kendo.toString(dateRangeUtil.getCurrentMonth()[0], grc_format));
end.attr("data-val", kendo.toString(dateRangeUtil.getCurrentMonth()[1], grc_format));
break;
//上月
case "MONTH1":
begin.text(kendo.toString(dateRangeUtil.getPreviousMonth()[0], grc_format))
end.text(kendo.toString(dateRangeUtil.getPreviousMonth()[1], grc_format));
begin.attr("data-val", kendo.toString(dateRangeUtil.getPreviousMonth()[0], grc_format));
end.attr("data-val", kendo.toString(dateRangeUtil.getPreviousMonth()[1], grc_format));
break;
//本季
case "QUARTERLY":
begin.text(kendo.toString(dateRangeUtil.getCurrentSeason()[0], grc_format))
end.text(kendo.toString(dateRangeUtil.getCurrentSeason()[1], grc_format));
begin.attr("data-val", kendo.toString(dateRangeUtil.getCurrentSeason()[0], grc_format));
end.attr("data-val", kendo.toString(dateRangeUtil.getCurrentSeason()[1], grc_format));
break;
//今年
case "YEAR":
begin.text(kendo.toString(dateRangeUtil.getCurrentYear()[0], grc_format));
end.text(kendo.toString(dateRangeUtil.getCurrentYear()[1], grc_format));
begin.attr("data-val", kendo.toString(dateRangeUtil.getCurrentYear()[0], grc_format));
end.attr("data-val", kendo.toString(dateRangeUtil.getCurrentYear()[1], grc_format));
break;
//近一周
case "WEEK_1":
begin.text(kendo.toString(dateRangeUtil.dateRangeUtil.getdate(-6), grc_format));
end.text(kendo.toString(kendo.date.today(), grc_format));
begin.attr("data-val", kendo.toString(dateRangeUtil.getdate(-6), grc_format));
end.attr("data-val", kendo.toString(kendo.date.today(), grc_format));
break;
//近一月
case "MONTH_1":
begin.text(kendo.toString(dateRangeUtil.getdate(-29), grc_format));
end.text(kendo.toString(kendo.date.today(), grc_format))
begin.attr("data-val", kendo.toString(dateRangeUtil.getdate(-29), grc_format));
end.attr("data-val", kendo.toString(kendo.date.today(), grc_format));
break;
//近一年
case "YEAR_1":
begin.text(kendo.toString(dateRangeUtil.getdate(-364), grc_format));
end.text(kendo.toString(kendo.date.today(), grc_format))
begin.attr("data-val", kendo.toString(dateRangeUtil.getdate(-364), grc_format));
end.attr("data-val", kendo.toString(kendo.date.today(), grc_format));
break;
default:
begin.text("");
end.text("")
begin.attr("data-val", "");
end.attr("data-val", "");
break;
}
picker.dispose();

*若价格不公道,可以让提问者在平台追加赏金哦,平台是您利益的保证。你觉得当前的价格如何呢,奉上您珍贵的一票吧

虚高0人次 适中0人次 偏低0人次

分享海报会更快解决你的问题哦!分享海报

参考答案:

无情铁手 4年前解决
已赚4091.05元




简单的通过计算,算出相应的时间范围就解决了

此处可发布评论

评论(0

暂无评论,快来写一下吧
客服QQ 1913284695