cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vjacheslav Borisov (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CXF-6342) Undocumented feature to pass dates as Duration in JAX-RS-search
Date Wed, 15 Apr 2015 08:51:58 GMT

    [ https://issues.apache.org/jira/browse/CXF-6342?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14495869#comment-14495869
] 

Vjacheslav Borisov edited comment on CXF-6342 at 4/15/15 8:51 AM:
------------------------------------------------------------------

Using relative dates in queries

Date value can be specified as duration from current date/time, as its string representation,
"PnYnMnDTnHnMnS".
Resulted date will be calculated as current date + specified duration.
Example:
?_search=date=ge=-P90D
Will search for date later 90 day in the past 


was (Author: slavb18):
Using relative dates in queries

Date value can be specified as duration from current date/time, as its string representation,
"PnYnMnDTnHnMnS".
Resulted date will be calculated as current date + specified duration.
Example:
?_search=date=ge=-P90D
Will search for date between 90 day in the past and now.

> Undocumented feature to pass dates as Duration in JAX-RS-search 
> ----------------------------------------------------------------
>
>                 Key: CXF-6342
>                 URL: https://issues.apache.org/jira/browse/CXF-6342
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-RS
>    Affects Versions: 3.0.4
>            Reporter: Vjacheslav Borisov
>            Priority: Minor
>
> Occasionally found useful, but undocumented feature to pass dates as Duration in JAX-RS-search.
I think it should be documented in
> http://cxf.apache.org/docs/jax-rs-search.html
> {code:title=AbstractSearchConditionParser.java|borderStyle=solid}
>             // is that duration?
>             try {
>                 Date now = new Date();
>                 DatatypeFactory.newInstance().newDuration(value).addTo(now);
>                 return now;
>             } catch (DatatypeConfigurationException e1) {
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message