How do I use a date/time input control with visualize.js (6.0.1)

I have a report that has a date/time input control, when I try to run the report using visualise.js I get an input control error. 

input.controls.validation.error : Input controls validation failure ["Specify a valid value for type Timestamp."]

The value I pass follows the format 'year-month-day hours-minutes-seconds' (ex. '2015-03-20 23:59:59'). so my parameter looks like this

var jasperParams = {
    ...
    endDate:['2015-03-20 23:59:59'],
    ...
}

I tried passing in a timestamp and got the same problem.

If I change the input control to type Date it works fine, but I need it to be type date/time.

Am I using the right format? I have only experienced this issue after upgrading from Jasper Reports Server 5.6 to Jasper Reports Server 6.0.1 so I assume I am using the correct format because it worked in version 5.6

tyson.decker's picture
Joined: Nov 13 2014 - 2:27pm
Last seen: 6 years 10 months ago

Checking the jasperserver_config.properties file, the datetime.format is yyyy-MM-dd HH:mm:ss and it hasn't changed since i upgraded

Furthermore, validation.datetime.pattern=/^\\d{4}-\\d{2}-\\d{2}\\s\\d{2}:\\d{2}:\\d{2}$/ which correctly matches the format i'm using. 

If anybody can help i'd really appreciate it.

 
tyson.decker - 8 years 4 days ago

1 Answer:

I was able to solve this by looking in the result from calling v.inputControls()

The validation object on the input control shows the pattern is "yyyy-MM-dd'T'HH:mm:ss"

changing my parameter from endDate:['2015-03-20 23:59:59'] to endDate:['2015-03-20T23:59:59'] solved the problem.

tyson.decker's picture
Joined: Nov 13 2014 - 2:27pm
Last seen: 6 years 10 months ago
Feedback
randomness