Hello, I am having with DateTime type over json.
type Record =
{ Id: int
Name: string
Time: int16
Start: DateTime
StartDisplay: string
Note: string
}
let data1 =
{ Id = x.Id
Name = x.Name
Time = x.Time
Start = DateTime(2016, 12, 13, 8, 00, 0)
StartDisplay = x.Start.ToString("hh:mm")
Note = x.Note
}
let JSON data =
JsonConvert.SerializeObject(data, Fable.JsonConverter())
When serializing data1 on the browser, Start is equal to 2016-12-13T08:00:00
(value printed in the console) so it's not a DateTime and just a string.
A DateTime is printed like this in the console:
[date] Wed Dec 14 2016 15:13:40 GMT+0100 (Paris, Madrid)[date] Wed Dec 14 2016 15:13:40 GMT+0100 (Paris, Madrid)
Can you please try with Fable.JsonConverter 0.1.0?
Yes, will test it tomorrow :)
I stumbled upon some edge cases with non-default culture environments and with DateTime.Kind = Unspecified
roundtripping. More info here https://github.com/fable-compiler/Fable/pull/613.