chriseldredge / Lucene.Net.Linq

LINQ provider to run native queries on a Lucene.Net index
Other
151 stars 65 forks source link

DateTime parse issue when sorting #28

Closed mcintyre321 closed 11 years ago

mcintyre321 commented 11 years ago

I'm trying to sort against a DateTime property, but am getting an error in

public class DateTimeConverter : TypeConverter
    {
       ... 
        public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
        {
            return DateTime.SpecifyKind(DateTime.ParseExact((string) value, format, null), DateTimeKind.Utc); //exception here. value="2013-04-30t07:12:47" but format = "yyyy-MM-ddTHH:mm:ss" 
        }
    }

I notice that the format has a capital T, but the value being parsed has a lower case t.

I will try to put together a test for this.

mcintyre321 commented 11 years ago

Closing in favour of https://github.com/themotleyfool/Lucene.Net.Linq/pull/29