Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Is There any difference between "PageStartPublish" and CurrentPage.StartPublish ?

Vote:
 


Hi,

I'm writing the code as below :

PropertyCriteriaCollection criterions;
PropertyCriteria DateCriteria = new PropertyCriteria();
			
 criterions = new PropertyCriteriaCollection();
DateCriteria.Condition = EPiServer.Filters.CompareCondition.GreaterThan;
                    DateCriteria.Type = PropertyDataType.Date;
                    DateCriteria.Name = "PageStartPublish";
                    DateCriteria.Value = new DateTime(DateTime.Now.Year - 1, 12, 31).ToString();
                    DateCriteria.Required = true;
                    criterions.Add(DateCriteria);
					
pages = DataFactory.Instance.FindPagesWithCriteria(CurrentPage.PageLink, criterions);
					
foreach (var page in pages)
                        {
                            if (page.StartPublish <= DateTime.Now && page.StopPublish > DateTime.Now)
                            {
                                    litNewsListing.Text += "<dt><a href=\"" + page.LinkURL + "\"><span>" + page.StartPublish.ToShortDateString() + "</span><b>" + page["PageTitle"].ToString() + "</b></a></dt>";
                                    litNewsListing.Text += "<dd>" + page["PageMetaData"].ToString() + " <a href=\"" + page.LinkURL + "\">" + Translate("/trw/pagesummary/submit") + "</a></dd>";
                            }
                        }

    

The Above code should filter all the pages and should return only the pages that are published in this current year.
I can see most of the pages are filtered out except 3 pages.
When looked at the admin section, Those 3 pages are showing the published date as 2012.

Can you please give me a clue why I'm seeing the pages of 2012, when filtered for current year pages(2013).

Thanks.
Kishore

#79369
Dec 16, 2013 7:41
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.