Try our conversational search powered by Generative AI!

Date problem

Vote:
 

I imported some pages from a SP1 installation with Stop Publish Date "9999-12-31 23:59".

Now when trying to expand that node i get the following "Error: You must enter a value between 1/1/1753 and 12/31/9999 for "EPiServer.Core.PropertyDate"."

Bug or feature?

#24778
Oct 07, 2008 17:43
Vote:
 

SP1 supported only dates from January 1, 1900, through June 6, 2079 so I assume you added that date programmatically, those pages are not editable.

There are 2 bugs fixed in R2:

  1. PropertyDate does not validate input values when assigning Value (only in the constructor)
  2. PropertyDate has min/max values that do not correspond with database types

So, in R2 the values are validated both from code and in edit and the min/max values are upgraded to January 1, 1753, through December 31, 9999.

#24845
Oct 08, 2008 10:44
Vote:
 

Thanks for the info. The wierd thing is that i can access them in edit in SP1(maybe is SP2), not sure about saving though. But in R2 i can't even expand that node.

Shouldn't I be able to have the date '9999-12-31 23:59', or do I need to use one day before this date?

#24847
Oct 08, 2008 11:10
Vote:
 

You can view the page in R1 but you can't save it, this invalid state was caused by one of the fixed bugs above.

You can use the static property PropertyDate.MaxValue to find out the maximum supported value, in R2 its defined as new DateTime(9999, 12, 31). In R1 it is defined as new DateTime(2079,06,06).

 

#24848
Edited, Oct 08, 2008 11:33
Vote:
 

Ok, the problem in this case is that i've used DateTime.MaxValue.

PropertyDate.MaxValue = 12/31/9999 12:00:00 AM
DateTime.Maxvalue = 12/31/9999 11:59:59 PM

I will use PropertyDate.MaxValue instead, but is there a reason why they have to differ?

#24852
Oct 08, 2008 12:25
Vote:
 

DateTime.MaxValue is actually 23:59:59.9999999 which cannot be represented in SQL2005 so it gets rounded off to a lower value of 23:59:59.997. Not a perfect match between the types.

 

 

 

 

#24945
Oct 08, 2008 13:54
Vote:
 

I also receive this error when i import from Epi7 to Epi 7.5, even content do not have this kind of date range. 

You must enter a value between 01/01/1753 and 12/31/9999 for "EPiServer.Core.PropertyDate".

Is there any solution ?

#79181
Dec 10, 2013 16:32
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.