# CMS - how to compare and hide 'modify date'

**URL:** <https://forums.realmacsoftware.com/t/cms-how-to-compare-and-hide-modify-date/57016>\
**Category:** Elements\
**Created:** [July 16, 2026, 6:07am UTC](https://forums.realmacsoftware.com/t/cms-how-to-compare-and-hide-modify-date/57016 "2026-07-16T06:07:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ttang](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/ttang/32/19285_2.png) [@ttang](https://forums.realmacsoftware.com/u/ttang)\
**Post date:** [July 16, 2026, 6:07am UTC](https://forums.realmacsoftware.com/t/cms-how-to-compare-and-hide-modify-date/57016/1 "2026-07-16T06:07:36Z")

</div>

I have a set of MD files. They have ‘publish date’ and ‘modify date’.  
I try to hide modify date if publish date is same as modify date but failed.  
I used the following code:  
{{% if item.m\_date != item.p\_date %} \<p›m-Date: {{ item.m\_date|date(“Y-m-d”) }}

 (% endif %}}  
I attach my project link here : [project](elementsapp://downloadDocument/M22jBH9u5Cik)

Could someone pls. help me to fix the problem?  
TIA

---

<div class="post-metadata">

**Author:** ![upssjw](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/upssjw/32/26063_2.png) [@upssjw](https://forums.realmacsoftware.com/u/upssjw)\
**Post date:** [July 16, 2026, 7:06am UTC](https://forums.realmacsoftware.com/t/cms-how-to-compare-and-hide-modify-date/57016/2 "2026-07-16T07:06:02Z")

</div>

@ttang

not sure if this is what you want, you used {{ instead of { for if statements + other syntax errors

[elementsapp://downloadDocument/996ynqBcFL50](elementsapp://downloadDocument/996ynqBcFL50)

---

<div class="post-metadata">

**Author:** ![ttang](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/ttang/32/19285_2.png) [@ttang](https://forums.realmacsoftware.com/u/ttang)\
**Post date:** [July 16, 2026, 7:39am UTC](https://forums.realmacsoftware.com/t/cms-how-to-compare-and-hide-modify-date/57016/3 "2026-07-16T07:39:58Z")

</div>

Thanks for your help! that’s what I want.  
However, one more question.  
There appears to be an empty line above the “modify date”. Can I avoid this?  
TIA  
Pls. check picture below

 ![cms m date gap](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/e/f/ef871fec19a61a0156e4739707be293c1fc49d63.png)

---

<div class="post-metadata">

**Author:** ![upssjw](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/upssjw/32/26063_2.png) [@upssjw](https://forums.realmacsoftware.com/u/upssjw)\
**Post date:** [July 16, 2026, 7:47am UTC](https://forums.realmacsoftware.com/t/cms-how-to-compare-and-hide-modify-date/57016/4 "2026-07-16T07:47:44Z")

</div>

try this

[elementsapp://downloadDocument/rRhtrTdsQZRn](elementsapp://downloadDocument/rRhtrTdsQZRn)

---

<div class="post-metadata">

**Author:** ![ttang](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/ttang/32/19285_2.png) [@ttang](https://forums.realmacsoftware.com/u/ttang)\
**Post date:** [July 16, 2026, 8:03am UTC](https://forums.realmacsoftware.com/t/cms-how-to-compare-and-hide-modify-date/57016/5 "2026-07-16T08:03:49Z")

</div>

Thank you very much !
