Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Not really asking a question. Just putting this out there because of lack of documentation.
In Umbraco 8. Getting expired date of content has been moved. Probably to better handle publishing of cultured content.
Anyways myContent.ExpireDate is removed. myContent is a type of IContent you get from the content service.
You can get the expiration by:
var expiredate = myContent.ContentSchedule.FullSchedule.FirstOrDefault(a => a.Action == ContentScheduleAction.Expire).Date;
The contructor for ContentSchedule is
public ContentSchedule(string culture, DateTime date, ContentScheduleAction action)
So you can also query by culture if need be.
You can see this thread for setting a expire date: https://our.umbraco.com/forum/using-umbraco-and-getting-started/99648-programmatically-set-unpublish-date
Hi Ben
We could add this to the documentation!
The documentation for Umbraco is Open Source,
https://github.com/umbraco/UmbracoDocs
so you can create Issues or make PRs to add and update the information there to help others working with Umbraco.
I'm wondering whether it would make sense to add a paragraph to this page:
https://our.umbraco.com/Documentation/Getting-Started/Data/Scheduled-Publishing/
about retrieving Scheduled Publishing information programatically?
regards
Marc
I guess I could write something up. When I get a second free I'll go ahead an make a pull request on this page.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Getting Expired Dates from IContent
Not really asking a question. Just putting this out there because of lack of documentation.
In Umbraco 8. Getting expired date of content has been moved. Probably to better handle publishing of cultured content.
Anyways myContent.ExpireDate is removed. myContent is a type of IContent you get from the content service.
You can get the expiration by:
The contructor for ContentSchedule is
So you can also query by culture if need be.
You can see this thread for setting a expire date: https://our.umbraco.com/forum/using-umbraco-and-getting-started/99648-programmatically-set-unpublish-date
Hi Ben
We could add this to the documentation!
The documentation for Umbraco is Open Source,
https://github.com/umbraco/UmbracoDocs
so you can create Issues or make PRs to add and update the information there to help others working with Umbraco.
I'm wondering whether it would make sense to add a paragraph to this page:
https://our.umbraco.com/Documentation/Getting-Started/Data/Scheduled-Publishing/
about retrieving Scheduled Publishing information programatically?
regards
Marc
I guess I could write something up. When I get a second free I'll go ahead an make a pull request on this page.
is working on a reply...