laptop and a wrench

Erro

Javascript API Layer Definition does not work correctly with datetime values.

Última Publicação: August 25, 2014 ArcGIS API for JavaScript
Número de ID do Erro NIM038387
EnviadoSeptember 11, 2008
Última ModificaçãoJune 5, 2024
Aplica-se àArcGIS API for JavaScript
Versão encontrada9.3
StatusDuplicate

Informações Adicionais

Duplicate of NIM042471. At 10.0 REST API supports input in JSON representation for defintion query which should be used for this case.

Solução Provisória

1) add a new field (in the database) to store a numeric date representation (float, e.g.).2) convert values in the date field to the new numeric field.3) alter javascript code according to the following example to apply the definition based on the numeric field values (without any conversion of dates whatsoever):layerDefs[0] = "DateFloat < 20071231235900"; //value is: YYYYMMDDhhmmssYou could also store datetime values in a float field in the same format used by the JavaScript getTime() function (milliseconds since midnight of 1/1/1970). Use getTime() in the application to convert the desired datetime for the layer definition. Something like:d = new Date();d.setMonth(12);d.setDate(31);d.setYear(2007);d.setHours(23);d.setMinutes(59);d.setSeconds(0);time = d.getTime();layerDefs[0] = "DateMS > " + time;

Etapas para Reproduzir

ID do Erro: NIM038387

Software:

  • ArcGIS API for JavaScript

Seja notificado quando o status de um erro mudar

Baixe o Aplicativo de Suporte da Esri

Descubra mais sobre este tema

Obtenha ajuda de especialistas do ArcGIS

Entre em contato com Suporte Técnico

Baixe o Aplicativo de Suporte da Esri

Ir para as opções de download