LxDateTime.CreateGYear(2020); throws an error
Question asked by P M - September 16 at 5:09 PM
Answered
When calling LxDateTime.CreateGYear(2020); I'm get an exception: LiquidTechnologies.XmlObjects.LxInvalidValueException
  HResult=0x80131500
  Message=Invalid Month [0] (1 <= month <= 12)
  Source=LiquidTechnologies.XmlObjects.Runtime
  StackTrace:
   at LiquidTechnologies.XmlObjects.LxDateTime.Validate()
   at LiquidTechnologies.XmlObjects.LxDateTime..ctor(LxDateTimeType type, Int32 year, Byte month, Byte day, Byte hour, Byte minute, Byte second, Int16 milli, Int16 micro, Int16 nano, Boolean isUTC)
   at LiquidTechnologies.XmlObjects.LxDateTime.CreateGYear(Int32 year, Boolean isUtc)
   at ConsoleApp1.Program.Main(String[] args) in C:\Users\pawel.mieczkowski\source\repos\ConsoleApp5\ConsoleApp1\Program.cs:line 11

1 Reply

Reply to Thread
0
Liquid Support Replied
Employee Post Marked As Answer
Thanks for pointing this out, the issue has been fixed and will be in the next point release.
In the meantime you can work around the issue by using the following code:

new LxDateTime(LxDateTimeType.GYear, year, 0, 0, 0, 0, 0, 0, 0, 0, isUtc)

Reply to Thread