Skip to content
Snippets Groups Projects
Commit 9d9d336a authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Fixed forecast search for multiple orgs in previous seasons

parent acfdc131
No related branches found
No related tags found
2 merge requests!22Develop,!18Spotit nordic map layers
This commit is part of merge request !18. Comments created here will be created in the context of that merge request.
......@@ -395,15 +395,26 @@ public class LogicService {
@Produces("application/json;charset=UTF-8")
public Response getActiveForecastConfigurationsWithIncludeOrganizations(
@PathParam("organizationId") Integer organizationId,
@QueryParam("includeOrganizationIds") String includeOrganizationIds
@QueryParam("includeOrganizationIds") String includeOrganizationIds,
@QueryParam("from") String fromStr,
@QueryParam("to") String toStr
)
{
Calendar cal = Calendar.getInstance();
cal.setTime(SystemTime.getSystemTime());
cal.set(cal.get(Calendar.YEAR), Calendar.JANUARY, 1, 0, 0, 0);
Date from = cal.getTime();
cal.set(cal.get(Calendar.YEAR), Calendar.DECEMBER, 31, 23, 0, 0);
Date to = cal.getTime();
Date from, to;
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
try{
from = format.parse(fromStr);
to = format.parse(toStr);
}
catch(ParseException | NullPointerException ex)
{
Calendar cal = Calendar.getInstance();
cal.setTime(SystemTime.getSystemTime());
cal.set(cal.get(Calendar.YEAR), Calendar.JANUARY, 1, 0, 0, 0);
from = cal.getTime();
cal.set(cal.get(Calendar.YEAR), Calendar.DECEMBER, 31, 23, 0, 0);
to = cal.getTime();
}
List<Integer> orgIds = new ArrayList<>();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment