System.FormatException: String was not recognized as a valid DateTime. at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) at umbraco.library.DateGreaterThanOrEqualToday(String firstDate)
The meetingDate is a date picker with time on a media content. I have checked the 10+ meetings in the system and they all have a value.
This is a weird one, it is outputting the meeting title, location etc but not the date, we have commented out the if test and we get no meeting date returned, any ideas why this could be?
'meetingDate' used to be called 'meetingDateTime', it was changed to reflect that we don't use the time portion in output or selection. It appears that the new name for the property did not update when the name was changed. I have gone in and manually updated each date and the dates now appear.
Good to know, if you change a few property names, always remember to publish the entire site, so the cached xml gets refreshed and gets populated with the correct property aliases
I'm getting the same thing. We haven't changed any property names, and it was working previously. We are using umbraco v 4.0.3 (Assembly version: 1.0.3625.27276).
System.FormatException: String was not recognized as a valid DateTime. at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) at umbraco.library.DateGreaterThanOrEqualToday(String firstDate)
I've search the forums, and tried adding a FormatDateTime function, but I'm not having any success at getting over this hurdle.
The error message is a pretty good indication of the presence of one or more 'Date' properties with bad data - try the following lines and see what you get:
<!-- Grab the eventItem nodes for easier access afterwards: -->
<xsl:variable name="eventItems" select="$currentPage/..//node[@nodeTypeAlias = 'eventItem']" />
<!-- Count them all: -->
<p><xsl:value-of select="count($eventItems)" /></p>
<!-- Count the number of eventItems with a Date property: -->
<p><xsl:value-of select="count($eventItems[data[@alias = 'Date']])" /></p>
<!-- Count the number of eventItems with a non-empty Date property: -->
<p><xsl:value-of select="count($eventItems[normalize-space(data[@alias = 'Date'])])" /></p>
Are you getting the same number of nodes in all cases?
FormatException using DateGreaterThanOrEqualToday
Hi all,
I have this test in my xsl:if
However this is throwing an error
System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at umbraco.library.DateGreaterThanOrEqualToday(String firstDate)
The meetingDate is a date picker with time on a media content. I have checked the 10+ meetings in the system and they all have a value.
Thanks
Darryl,
Looks like you've forgot to enter the xslt context, either use
if you're inside a loop or
if you're getting the property from the current page being requested
Hope this helps.
Regards,
/Dirk
Still coming up with the same error..
Just to expand, it is sat inside a loop:
thanks
This is a weird one, it is outputting the meeting title, location etc but not the date, we have commented out the if test and we get no meeting date returned, any ideas why this could be?
Thanks,
Maybe a bug found here.
'meetingDate' used to be called 'meetingDateTime', it was changed to reflect that we don't use the time portion in output or selection. It appears that the new name for the property did not update when the name was changed. I have gone in and manually updated each date and the dates now appear.
As always, thanks for your help Dirk.
Good to know, if you change a few property names, always remember to publish the entire site, so the cached xml gets refreshed and gets populated with the correct property aliases
Cheers,
/Dirk
I'll mark yours as the answer, especially as I cannot answer my own answer ;)
I'm getting the same thing. We haven't changed any property names, and it was working previously. We are using umbraco v 4.0.3 (Assembly version: 1.0.3625.27276).
The line where we get the error is:
The exact error is:
Error occured
System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at umbraco.library.DateGreaterThanOrEqualToday(String firstDate)
I've search the forums, and tried adding a FormatDateTime function, but I'm not having any success at getting over this hurdle.
Any suggestions would be appreciated!
Thank you!
--Kent
Hi Kent,
The error message is a pretty good indication of the presence of one or more 'Date' properties with bad data - try the following lines and see what you get:
/Chriztian
is working on a reply...