laptop and a wrench

漏洞

Null values for date fields are not calculated correctly in Map Viewer when using symbology from an Arcade expression.

上次发布: January 3, 2023 ArcGIS Online
漏洞 ID 编号 BUG-000154016
已提交November 29, 2022
上次修改时间August 23, 2024
适用范围ArcGIS Online
找到的版本November 2022
操作系统Windows OS
操作系统版本10.0 64 Bit
状态As Designed

附加信息

When a null value is passed to the Arcade Date function, it gets implicitly converted to the number 0. Date(0) will return the date based on the number of milliseconds since Jan 1 1970 UTC (in this case 0). To avoid this implicit casting, add null checks in the Arcade expression. Documentation on implicit casting: https://developers.arcgis.com/arcade/guide/type-casting/#implicit-number-casting Date function documentation: https://developers.arcgis.com/arcade/function-reference/date_functions/#dateepoch---date

解决办法

Check for null values before creating the date and passing it into the DateDiff function:

var retire = $feature["dateField"]; //.

This is already a date field, and does not need to use the Date() function if (!IsEmpty(retire)) { return IIF(DateDiff(Now(), retire, 'days') >= 0, "retired", "active") } returns null.

重现步骤

漏洞 ID: BUG-000154016

软件:

  • ArcGIS Online

当漏洞状态发生变化时获得通知

下载 Esri 支持应用程序

发现关于本主题的更多内容

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项