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
|
* Returns the formatted start (i.e. lower bound) of a range query.
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
private String getDateStart(Pair<Date, Integer> dateAndResolution)
|
private String getDateStart(Pair<Date, Integer> dateAndResolution)
|
||||||
{
|
{
|
||||||
@@ -4507,24 +4506,22 @@ public class Solr4QueryParser extends QueryParser implements QueryConstants
|
|||||||
case Calendar.MILLISECOND:
|
case Calendar.MILLISECOND:
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
SimpleDateFormat formatter = CachingDateFormat.getSolrDatetimeFormat();
|
return CachingDateFormat.getSolrDatetimeFormat().format(cal.getTime());
|
||||||
formatter.setTimeZone(TimeZone.getTimeZone("UTC"));
|
|
||||||
return formatter.format(cal.getTime());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Pair<Date, Integer> parseDateString(String dateString)
|
private Pair<Date, Integer> parseDateString(String dateString)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Pair<Date, Integer> result = CachingDateFormat.lenientParse(dateString, Calendar.YEAR);
|
return CachingDateFormat.lenientParse(dateString, Calendar.YEAR);
|
||||||
return result;
|
|
||||||
} catch (java.text.ParseException e)
|
} catch (java.text.ParseException e)
|
||||||
{
|
{
|
||||||
SimpleDateFormat oldDf = CachingDateFormat.getDateFormat();
|
SimpleDateFormat oldDf = CachingDateFormat.getDateFormat();
|
||||||
|
oldDf.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Date date = oldDf.parse(dateString);
|
Date date = oldDf.parse(dateString);
|
||||||
return new Pair<Date, Integer>(date, Calendar.SECOND);
|
return new Pair<>(date, Calendar.SECOND);
|
||||||
} catch (java.text.ParseException ee)
|
} catch (java.text.ParseException ee)
|
||||||
{
|
{
|
||||||
if (dateString.equalsIgnoreCase("min"))
|
if (dateString.equalsIgnoreCase("min"))
|
||||||
|
Reference in New Issue
Block a user