mirror of
https://github.com/Alfresco/SearchServices.git
synced 2025-09-17 14:21:20 +00:00
[ SEARCH-2376 ] Fix timezone mgmt on IE (#904)
* [ SEARCH-2376 ] Fix timezone mgmt on IE * [ SEARCH-2376 ] Restrict the test timezones by unique offset + Junit repeater (cherry picked from commit bb88db5864b4c1713d2681268e29a0c74f03e2ec)
This commit is contained in:
committed by
agazzarini
parent
2b683b055c
commit
29d1c7f438
@@ -4483,8 +4483,7 @@ public class Solr4QueryParser extends QueryParser implements QueryConstants
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dateAndResolution
|
||||
* @return
|
||||
* Returns the formatted start (i.e. lower bound) of a range query.
|
||||
*/
|
||||
private String getDateStart(Pair<Date, Integer> dateAndResolution)
|
||||
{
|
||||
@@ -4507,24 +4506,22 @@ public class Solr4QueryParser extends QueryParser implements QueryConstants
|
||||
case Calendar.MILLISECOND:
|
||||
default:
|
||||
}
|
||||
SimpleDateFormat formatter = CachingDateFormat.getSolrDatetimeFormat();
|
||||
formatter.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
return formatter.format(cal.getTime());
|
||||
return CachingDateFormat.getSolrDatetimeFormat().format(cal.getTime());
|
||||
}
|
||||
|
||||
private Pair<Date, Integer> parseDateString(String dateString)
|
||||
{
|
||||
try
|
||||
{
|
||||
Pair<Date, Integer> result = CachingDateFormat.lenientParse(dateString, Calendar.YEAR);
|
||||
return result;
|
||||
return CachingDateFormat.lenientParse(dateString, Calendar.YEAR);
|
||||
} catch (java.text.ParseException e)
|
||||
{
|
||||
SimpleDateFormat oldDf = CachingDateFormat.getDateFormat();
|
||||
oldDf.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
try
|
||||
{
|
||||
Date date = oldDf.parse(dateString);
|
||||
return new Pair<Date, Integer>(date, Calendar.SECOND);
|
||||
return new Pair<>(date, Calendar.SECOND);
|
||||
} catch (java.text.ParseException ee)
|
||||
{
|
||||
if (dateString.equalsIgnoreCase("min"))
|
||||
|
Reference in New Issue
Block a user