【发布时间】:2019-04-10 14:26:40
【问题描述】:
我有一个包含未来日期的列,我想使用修改后的 JavaScript 步骤减去年份并添加月份。
CloseDate 的数据类型为Date,格式为 mm/dd/yyyy。例如01/10/2020
我尝试了以下方法:
var newDate;
year(CloseDate) = year(CloseDate)-1;
month(CloseDate) = month(CloseDate)+5;
newDate = CloseDate;
但它没有修改日期,我收到以下错误:
Modified JavaScript value.0 - Javascript error:
Modified JavaScript value.0 - ReferenceError: Function function year() {
[native code, arity=1]
}
can not be used as the left-hand side of assignment or as an operand of ++ or -- operator. (script#11)
我的 JavaScript 代码中是否缺少某些内容?
【问题讨论】:
-
CloseDate是字符串吗?如果是这样,它是什么样子的,你能举个例子吗 -
请提供minimal reproducible example。确保声明了所有必要的函数和变量。
标签: javascript date pentaho pentaho-spoon pentaho-data-integration