Skip to content

Commit

Permalink
Merge pull request #30 from valadas/Issue17
Browse files Browse the repository at this point in the history
Fixed import issue with null date values
  • Loading branch information
valadas committed Jun 30, 2018
2 parents c1f4f7a + 4147f2d commit aa80351
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Components/FAQsController.cs
Expand Up @@ -509,6 +509,10 @@ public void ImportModule(int moduleID, string content, string version, int userI
try
{
faq.PublishDate = DateTime.Parse(xFaq.Element("publishdate").Value);
if (faq.PublishDate.HasValue && faq.PublishDate.Value == Null.NullDate)
{
faq.PublishDate = null;
}
}
catch (Exception)
{
Expand All @@ -518,7 +522,12 @@ public void ImportModule(int moduleID, string content, string version, int userI
try
{
faq.ExpireDate = DateTime.Parse(xFaq.Element("expiredate").Value);
if (faq.ExpireDate.HasValue && faq.ExpireDate.Value == Null.NullDate)
{
faq.ExpireDate = null;
}
}

catch (Exception)
{
faq.ExpireDate = null;
Expand Down

0 comments on commit aa80351

Please sign in to comment.