0

当使用表单列表中的链接删除记录时,作为日期时间字段的 fromDate 以隐藏形式保持格式化值,如下所示。在 demo.moqui.org 的示例中,它是一个纯字符串,例如“1393454169956”。格式化的有问题,因为它与时区有关。

<input type="hidden" value="TEST1" name="exampleId">
<input type="hidden" value="2014-02-27 06:36:09.956" name="fromDate">
<input type="hidden" value="100001" name="exampleFeatureId">

那么如何使它成为纯字符串呢?

4

2 回答 2

1

There is an improvement in Moqui Framework in commit #10d9e00: Changed URL parameters to use the same method as hidden form fields for the parameter value. For links rendered as hidden forms, which this question is based on, this will improve the behavior.

In general Moqui both formats and parses date/time values using the current user's time zone. If there are any exceptions to that found (like this one) it is a bug.

于 2014-03-01T20:42:15.010 回答
0

要使日期值像“1393454169956”,它需要字段的类型是“时间戳”而不是“日期时间”。from Date 是“date-time”,因此如果使用“update#ProductContent”的自动服务,它会从 ProductContent 实体定义中将“fromDate”字段识别为“date-time”。但是如果一个服务被定义为“delete#ProductContent”并且它的fromDate参数是“Timestamp”的类型,那么输出值将会是“1393454169956”。

更重要的是,要使用“时间戳”格式的参数,它需要将其传递给一个参数定义为“时间戳”的服务(服务引擎会自动将其转换为日期时间)或使用 eci 手动解析它.l10n.parseTimestamp

于 2014-02-28T06:20:01.933 回答