You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2021/11/18 18:51:54 UTC

[lucenenet] branch master updated: BUG: Lucene.Net.Tests.QueryParser.Flexible.Standard.TestQPHelper: Use ParseExact to specify the date format to parse, so it works across cultures. See: https://github.com/dotnet/runtime/issues/61708#issuecomment-971116350

This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git


The following commit(s) were added to refs/heads/master by this push:
     new 9a39013  BUG: Lucene.Net.Tests.QueryParser.Flexible.Standard.TestQPHelper: Use ParseExact to specify the date format to parse, so it works across cultures. See: https://github.com/dotnet/runtime/issues/61708#issuecomment-971116350
9a39013 is described below

commit 9a39013ba020e7089994a0bd06e999480ae487bd
Author: Shad Storhaug <sh...@shadstorhaug.com>
AuthorDate: Wed Nov 17 10:47:42 2021 +0700

    BUG: Lucene.Net.Tests.QueryParser.Flexible.Standard.TestQPHelper: Use ParseExact to specify the date format to parse, so it works across cultures. See: https://github.com/dotnet/runtime/issues/61708#issuecomment-971116350
---
 src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestQPHelper.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestQPHelper.cs b/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestQPHelper.cs
index 7174662..c7b33b4 100644
--- a/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestQPHelper.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Flexible/Standard/TestQPHelper.cs
@@ -741,7 +741,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard
             //DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, Locale.getDefault());
             //return getDate(df.parse(s), resolution);
 
-            return GetDate(DateTime.Parse(s), resolution); // TODO: Locale...
+            return GetDate(DateTime.ParseExact(s, "d", null), resolution);
         }
 
         /** for testing DateTools support */