[OpenLayers-Users] DATE Filter.Comparison

Andreas Hocevar ahocevar at opengeo.org
Thu Mar 24 04:23:31 EDT 2011


Hi,

comparing dates is straightforward. The ISO date and dateTime formats used by WFS allow for alphanumeric sort, so you can use greater-than and less-than filters without any problems. You create the filter the same way you would for comparing strings, and for the values you use ISO date and dateTime strings:

For example:
2011-03-01Z (which is < 2011-04-01Z)
2011-03-24T09:12:12Z (which is < 2011-04-01Z00:00:00Z)

Regards,
Andreas.

On Mar 8, 2011, at 15:36 , Carlos Krefft wrote:

> Dear OpenLayer Users:
>  
> I would like to make a WFS GetFeature requests with a filter that will allow me to narrow features by Date. Is this possible? Does anyone have any example code snippet or tips on how to define this filter?
>  
> This example shows how to use the filter with a basic string value:
> http://openlayers.org/dev/examples/wfs-filter.html
>  
> Has anyone used the OpenLayers.Filter.Comparison class for dates?
>  
> Kind Regards,
> Carlos Krefft
>  
>  
>  
> Carlos Krefft
> Software Development Engineer
> Center for Southeastern Tropical Advanced Remote Sensing (CSTARS)
> University of Miami
> 11811 SW 168th Street
> Miami, FL 33177
>  
> ckrefft at rsmas.miami.edu
>  
>  
>  
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users



-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.



More information about the Users mailing list