天翎MyApps技术社区 - 低代码平台 | 流程管理系统 | BPM软件

 找回密码
 注册成为天翎用户
查看: 1683|回复: 7

根据日期判断星期

[复制链接]
aiwo312 发表于 2012-4-17 11:10:50 | 显示全部楼层 |阅读模式
本帖最后由 irene 于 2012-5-7 10:17 编辑

你好,请问平台是否封装:根据日期判断星期的函数,如果没有,如何实现该功能呢?
purple 发表于 2012-4-17 11:27:34 | 显示全部楼层
您好,不太明白您说的具体是什么效果,是根据日期返回今天星期几还是怎么?请详细描述您的需求,谢谢。
 楼主| aiwo312 发表于 2012-4-17 11:28:46 | 显示全部楼层
恩,根据日期返回星期几。
irene 发表于 2012-4-17 11:30:52 | 显示全部楼层
您好,您可以参考这个帖子:http://www.teemlink.com/bbs/view ... 26amp%3Btypeid%3D35
有问题我们再沟通
 楼主| aiwo312 发表于 2012-4-17 11:56:49 | 显示全部楼层
出现bug:org.mozilla.javascript.EvaluatorException: The choice of Java constructor replace matching JavaScript argument types (function,string) is ambiguous; candidate constructors are:
源代码如下:
var weekDay = ["星期天", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];  
var dateStr = format(getItemValueAsDate("记录时间"),"yyyy-MM-dd");
println(dateStr);
var myDate = new Date(Date.parse(dateStr.replace(/-/g, "/")));  
var value = weekDay[myDate.getDay()];
value;
 楼主| aiwo312 发表于 2012-4-17 14:39:53 | 显示全部楼层
println(dateStr); 语句的输出结果为:
2012-04-17
irene 发表于 2012-4-17 15:26:38 | 显示全部楼层
您稍等,我测试一下,稍后回复您
irene 发表于 2012-4-17 16:15:08 | 显示全部楼层
我测过了,用您的脚本测试了,确实出现您的问题,我重新编辑了帖子,第二段代码,您先参考一下:
http://www.teemlink.com/bbs/view ... mp;extra=#pid190615

本版积分规则

QQ|手机版|天翎MyApps技术社区 ( 粤ICP备11093750号 )

GMT+8, 2026-8-13 00:40

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表