<p>The simplest solution would probably to just have two normal Date fields:</p>

<ul>
<li>Start Date</li>
<li>End Date</li>
</ul>

<p>And then in Twig, just show blocks that fall between those dates.</p>

CC BY-SA 3.0
2018-02-16T17:36:16.037Z
2018-02-16T17:36:16.037Z
Lindsey D
<p>Yes you can definitely do this. The huge advantage of Craft is it's ability to customize nearly everything.</p>

<p>You can create a <code>date</code> field in your matrix block and check if the current date <code>{{ now|date }}</code> is lower than the date specified in the field.</p>

<p>If the condition is true, you'll display the matrix block if not you can either just hide it or you could create a <a href="https://craftcms.com/docs/plugins/introduction" rel="nofollow noreferrer">plugin</a> with a <a href="https://craftcms.com/docs/plugins/variables" rel="nofollow noreferrer">template variable </a> to delete the block. </p>

<pre><code>craft()-&gt;matrix-&gt;deleteBlockType($yourBlock);
</code></pre>

CC BY-SA 3.0
2018-02-16T17:38:46.377Z
2018-02-16T17:38:46.377Z
Robin Schambach
<p>To replace my current CMS I will need to have parts of pages change without the whole page change. As I'm looking at using matrix blocks for building pages, it would seem to be easy for an editor to schedule matrix blocks...</p>

<p>Is there a way to do this or a better approach?</p>

<matrix><postdate><expiration>
Has anyone come up with a solution where matrix blocks can be scheduled and expire?
# Has anyone come up with a solution where matrix blocks can be scheduled and expire?

(Asked by: username_0 on 2018-02-16)

To replace my current CMS I will need to have parts of pages change without the whole page change. As I'm looking at using matrix blocks for building pages, it would seem to be easy for an editor to schedule matrix blocks...

Is there a way to do this or a better approach?

**Tags:** matrix, postdate, expiration


---

## 2 answers

### Answer by username_1 on 2018-02-16. Score: 1 | Accepted answer

The simplest solution would probably to just have two normal Date fields:

* Start Date
* End Date

And then in Twig, just show blocks that fall between those dates.


---

### Answer by username_2 on 2018-02-16. Score: 2

Yes you can definitely do this. The huge advantage of Craft is it's ability to customize nearly everything.
You can create a date field in your matrix block and check if the current date {{ now|date }} is lower than the date specified in the field.
If the condition is true, you'll display the matrix block if not you can either just hide it or you could create a plugin with a template variable  to delete the block. 
craft()->matrix->deleteBlockType($yourBlock);


---

